Question:What is $scope and $rootScope? 

Answer $scope - A $scope is a JavaScript object which is used for communication between controller and view. Basically, $scope binds a view (DOM element) to the model and functions defined in a controller. $rootScope - The $rootScope is the top-most scope. An app can have only one $rootScope which will be shared among all the components of an app. Hence it acts like a global variable. All other $scopes are children of the $rootScope. 

+ Report
Total Preview: 957
What is $scope and $rootScope?
Copyright © 2024. Powered by Intellect Software Ltd