html:
<p class="list list-inset">
<ion-toggle toggle-class="toggle-calm" ng-model="remeberUser" ng-checked="remeberUser">
记住账号{{remeberUser}}
</ion-toggle>
</p>
js:
$scope.remeberUser 获取不到值是怎么一回事呢
我的页面点击就可以显示这个值,而js取不到,这是为什么
You can bind a click event above and try passing remberUser as a parameter
The reason is very simple. There is a one-way flow of data between the parent and child component $scope. The child $scope can access the data model state under the parent scope, but not the other way around. This is because string and Boolean data are basic types and can be shared by reference through objects, such as parentData.remberUer. Or distribute $scope.$emit through events in the child scope, and then listen to $scope.$on in the parent scope.
You can refer to this article: http://www.jianshu.com/p/0fc2...