国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

angular.js - ??? $.post? $scope? ???? ? ????($.post? $http.post ?? ??? ??).
大家講道理
大家講道理 2017-05-15 16:52:49
0
3
606

??? ?? $scope.equipments=... ??? $.post? ??? $scope.equipments? ???? ? ????. ? ?????

????
大家講道理
大家講道理

光陰似箭催人老,日月如移越少年。

?? ??(3)
洪濤

@lee1994522?? ??? ?? ? $.post ???? ???? ? Angle? ????? ????? Angle? $scope? ???? ? ??? ?? ??????. 脫離了angular的上下文,所以無(wú)法綁定到angular的$scope里。

this is the point,pls.. $.post is not an Angular issue and the stuff
it wraps is not in an Angular world,so it's obviously that the
equipments outside is in Angular's world and it works as you expect

try $scope.$apply() when you call a "none Angular" issue if you wanna
refresh sth

解決辦法有兩個(gè):

$.post

第一個(gè)誠(chéng)如@lee1994522所說(shuō),直接在$.post的回調(diào)函數(shù)的最后加上一句$scope.$apply()

??? ?????.. $.post? Angular ??? ??? ? ???
?? Angular ??? ?? ????
?? ??? Angular? ??? ??? ???? ?????

??? ?? "Angular ??" ??? ??? ? $scope.$apply()? ??? ???.
????

? ?? ???? ????:

$.???

? ??? @lee1994522? ???? $.post ?? ?? ?? $scope.$apply() ??? ?? ???? ?? ??? ?? ????? ????? ?????? ??? ??$http.post?? ??AngularJS - $http.post? JSON ?? ?? ????? ??? ???? ???? ??: ?? ??? ???? ?? ????? ??? ?????. ?? ???
曾經(jīng)蠟筆沒有小新

?? ???? $.post ??? ??? ? ????. $http

? ???? ??? ??????
給我你的懷抱

Your$.post不是angular的方法,所以實(shí)際上post的回調(diào)雖然執(zhí)行了,但angular在視圖上卻不知道這件事。你可以在$.post里的賦值操作后面再跟一句$scope.$apply();, ?? ?? ??? ?????.