The $ rootcope value used in the controller is overridden when refreshing the page used with this controller

On my angularjs page, I pass global data to another controller using the $ cccorncope angularjs object. In my controller, I can successfully catch the value stored in the $ rootscope object, and the value fills correctly, and I use the value in the contol label. But when I refresh the page, the value disappears. What is the problem with this and how can I deal with this situation.

$ scope.loginname = $ rootScope.curusername;

Thanks and welcome Utpal

+4
source share
2 answers

, , JavaScript, . $rootScope - JavaScript. -, , , , :

+6

Ok Utpal , :

  • AngularJS , , HTML5 localStorage Cookies .. , , , AngularJS , .

  • , $rootScope - . angularJS services .

, !

+1

Source: https://habr.com/ru/post/1523852/


All Articles