Difference between $scope and $rootScope

后端 未结 9 1761
孤城傲影
孤城傲影 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:43

    "$rootScope” is a parent object of all “$scope” angular objects created in a web page.

    $scope is created with ng-controller while $rootscope is created with ng-app.

提交回复
热议问题