In my angularjs page I am passing a global data to another controller using the $rootscope object of angularjs. In my controller i am successfully able to catch the value st
If you reload your page all information that you store in JavaScript variables are lost. $rootScope is nothing more then a variable in JavaScript. If you want to store something that persists a page reload there are at least the following possibilities:
Ok Utpal a few things to note here:
AngularJS will not persist between a full page reload, you have to use another mechanism to persist data between two different loads, like HTML5 localStorage or Cookies etc. The reason why refreshing the browser deletes your data is because the entire AngularJS app is being torn down and reloaded, so can't expect it to maintain state.
If you want to persist data between controllers, $rootScope isn't the best way. You should look up angularJS services and use them to communicate between controllers.
Hope this helps!