Why $rootscope is used in angularjs? can anyone tell the diffrence between scope and rootscope.
$rootscope.mystr='';
Why $rootscope is used in angularjs? can anyone tell the diffrence between scope and rootscope.
$rootscope.mystr='';
“$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
.