angular.js - rootScope可以取到值但是无法赋值
ringa_lee
ringa_lee 2017-05-15 16:55:13
0
1
545
 var successCallback = function(data) {
                alert($rootScope.isLoading);
                $rootScope.isLoading = false;
                $scope.items = JSON.stringify(data.Data.Rows);
            };
            var errorCallback = function(data) {
                alert(JSON.stringify(data));
            };

各位大神知道么..总得代码有点长...就贴了这一段

ringa_lee
ringa_lee

ringa_lee

reply all(1)
習慣沉默

You can try:

    var successCallback = function(data) {
                alert($rootScope.isLoading);
                $rootScope.isLoading = false;
                // 使用$apply()
                $scope.$apply();
                //
                $scope.items = JSON.stringify(data.Data.Rows);
            };
            var errorCallback = function(data) {
                alert(JSON.stringify(data));
            };
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!