Angular $scope variable not updating

后端 未结 6 1457
一整个雨季
一整个雨季 2021-01-02 04:19

In my angular, I define a scope variable $scope.letter_content. When the view is loaded, I load string from my database and set it to $scope.letter_conten

6条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-02 04:36

    Actually this has been discussed in more links.

    Don't use primitive type variable. Instead of that use object in scope.

    For example, Don't use like $scope.primitiveVariale instead of this $scope.object={primitiveVariale:null}

    So in view use like object.primitiveVariale then this will be reflect in all the view. Please see the following links.

    https://github.com/angular/angular.js/wiki/Understanding-Scopes

提交回复
热议问题