0

Why $rootscope is used in angularjs? can anyone tell the diffrence between scope and rootscope.

 $rootscope.mystr='';
vishnuprasad kv
  • 990
  • 5
  • 22
  • 46
  • 1
    The answer to this earlier SO question should help: http://stackoverflow.com/questions/22785775/difference-between-scope-and-rootscope – DenizEng Feb 22 '16 at 11:31
  • Please refer here: http://stackoverflow.com/questions/22785775/difference-between-scope-and-rootscope – Michal Kucaj Feb 22 '16 at 11:32

1 Answers1

3

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

enter image description here

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

enter image description here

Aayushi Jain
  • 2,861
  • 2
  • 29
  • 36