Angular js scope不是在ui上更新ng-model [英] Angular js scope is not updating ng-model on ui
问题描述
我从javascript调用angularjs控制器
angular.element(document.getElementById('controllername'))。scope()。functionname(ID) ;
来自使用ajax调用我正在获得范围的价值并使用$ scope.apply();
首次使用ng-model ios绑定数据并在UI上重新插入,但第二次该值在范围内但未反映在UI上(ng-model不是绑定数据)
如果您有任何解决方案,请帮助我。
谢谢
我尝试过:
I am calling a angularjs controller from a javascript
angular.element(document.getElementById('controllername')).scope().functionname(ID);
from ther by using a ajax call i am getting value to scope and use $scope.apply();
for first time ng-model ios binding data and refleted on UI but in second time the value is in the scope but not reflecting on UI(ng-model is not binding data)
please help me if you have any solution.
Thanks
What I have tried:
I am calling a angularjs controller from a javascript
angular.element(document.getElementById('controllername')).scope().functionname(ID);
from ther by using a ajax call i am getting value to scope and use $scope.apply();
for first time ng-model ios binding data and refleted on UI but in second time the value is in the scope but not reflecting on UI(ng-model is not binding data)
please help me if you have any solution.
Thanks
推荐答案
scope.apply();
首次使用ng-model ios绑定数据并在UI上重新插入,但第二次该值在范围内但未反映在UI上(ng-model不是绑定数据)
如果您有任何解决方案,请帮助我。
谢谢
我尝试过:
scope.apply();
for first time ng-model ios binding data and refleted on UI but in second time the value is in the scope but not reflecting on UI(ng-model is not binding data)
please help me if you have any solution.
Thanks
What I have tried:
I am calling a angularjs controller from a javascript
angular.element(document.getElementById('controllername')).scope().functionname(ID);
from ther by using a ajax call i am getting value to scope and use
scope.apply();
首次使用ng-model ios绑定数据并在UI上重新插入,但是第二次该值在范围内但没有反映在UI上(ng-model不是绑定数据)
如果您有任何解决方案,请帮助我。
谢谢
scope.apply(); for first time ng-model ios binding data and refleted on UI but in second time the value is in the scope but not reflecting on UI(ng-model is not binding data) please help me if you have any solution. Thanks
这篇关于Angular js scope不是在ui上更新ng-model的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!