時vm.loadStats被稱爲
var vm = this;
vm.loadStats = function(){
vm.propositions = null;
DateUtils.convertLocalDateToServer(vm.dateDebut);
vm.dateFinSever = DateUtils.convertLocalDateToServer(vm.dateDebut);
vm.propositions = PropositionsAffaireBetweenPropositionDates.get({dateDebut : vm.dateDebutServer, dateFin : vm.dateFinSever});
}
$scope.$watch(['vm.propositions'], function(newValues, oldValues) {
...
}
如果有誰知道爲什麼我的$範圍。$腕錶則不會觸發...
感謝
爲什麼你把表達式放在數組中?有特別的原因嗎? $ scope方法的角度文檔。$ watch方法表示這個參數應該是一個字符串或者一個函數 – Ripley511