Javascript ngCordova$监视功能不工作
我试图使一个函数在切换值更改时运行。 但它不能运行我的手表功能。只有在我的应用程序第一次打开时Javascript ngCordova$监视功能不工作,javascript,ios,angularjs,cordova,Javascript,Ios,Angularjs,Cordova,我试图使一个函数在切换值更改时运行。 但它不能运行我的手表功能。只有在我的应用程序第一次打开时 $scope.$watch('variable', function(){ alert('waarde: '+$scope.variable); }); 和我的html: <ul class="list"> <li class="item item-toggle"> {{variable}} <label class="to
$scope.$watch('variable', function(){
alert('waarde: '+$scope.variable);
});
和我的html:
<ul class="list">
<li class="item item-toggle">
{{variable}}
<label class="toggle toggle-assertive">
<input type="checkbox" ng-model="variable">
<div class="track">
<div class="handle"></div>
</div>
</label>
</li>
</ul>
它会在页面中更改,但不会在控制器中更改。
我怎样才能让它工作