2
Im new to angularjs。我試圖從列表理解調用方法,但不幸的是腳本失敗。看看plunk http://plnkr.co/5uPj81。angularjs:不能從列表理解中調用方法select
使用類似下面的代碼範圍變量時,一切正常
Province:<select ng-model="portinForm.address.provinceCode" ng-options="province.code for province in ProvinceList"></select>
然而,使用的方法來獲得該陣列時,我得到一個異常
Province:<select ng-model="portinForm.address.provinceCode" ng-options="province.code for province in getProvinceList()"></select>
例外:
Uncaught Error: [$rootScope:infdig] 10 $digest() iterations reached. Aborting!
Watchers fired in the last 5 iterations: [[{"msg":"fn: regularInterceptedExpression","newVal":16,"oldVal":14}],[{"msg":"fn: regularInterceptedExpression","newVal":18,"oldVal":16}],[{"msg":"fn: regularInterceptedExpression","newVal":20,"oldVal":18}],[{"msg":"fn: regularInterceptedExpression","newVal":22,"oldVal":20}],[{"msg":"fn: regularInterceptedExpression","newVal":24,"oldVal":22}]]
http://errors.angularjs.org/1.3.4/$rootScope/infdig?p0=10&p1=%5B%5B%7B%22ms…rInterceptedExpression%22%2C%22newVal%22%3A24%2C%22oldVal%22%3A22%7D%5D%5D
不支持角度!或者我在做一些事情。
感謝
有什麼區別? – Shomz 2014-12-05 00:47:18
您顯示的兩條線似乎相同。所以你描述的東西是不同的,我們需要看,而不是重複數據。 – 2014-12-05 00:49:29
我認爲這與getProvinceList()內更新的對象有關。確保你沒有更新該函數中的對象。 – Aidin 2014-12-05 00:54:02