我正在使用角度$ watch等。
基於觸發器selectedIndex值的變化。
$scope.selectedIndex = 1;
Trigger.onReceivingTriger($scope,function(data){
$scope.selectedIndex = 0;
});
$scope.$watch('selectedIndex', function(){
console.log("am watching");
});
我希望一旦工作正常,觸發值設置爲正常。但問題是,只有當我點擊屏幕上的某些元素後,$ watch纔會有效。 我被卡住了聽到... 請求幫助....
錯字也許消化週期?應該是onReceivingTrigger。只是一個猜測。 –
它只是一個函數名稱。 –