Difference between $scope and $rootScope

后端 未结 9 1804
孤城傲影
孤城傲影 2020-11-28 02:33

Can anyone explain the difference between $scope and $rootScope?

I think

$scope:

We can get ng-model properties in particular cont

9条回答
  •  佛祖请我去吃肉
    2020-11-28 02:40

    Every application has atleast one single rootScope and its lifecycle is the same as the app and every controller can have it's own scope, that is not shared with others.

    Have a look at this article :

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

提交回复
热议问题