0

I have separate login ng-app and index page ng-app So how would I get LoginData scope into index ng-app?

js-hint
  • 66
  • 1
  • 10

2 Answers2

0

you create a service and inject it as dependancy in your two controllers to share data between them. a service is a singleton.

many source on google, search "angularjs share data between controllers" : a good solution here Share data between AngularJS controllers

Community
  • 1
  • 1
AlainIb
  • 4,544
  • 4
  • 38
  • 64
  • i am not asking about between two controller – js-hint May 05 '15 at 08:06
  • sorry. misunderstand your need. maybe with cookies ? – AlainIb May 05 '15 at 08:18
  • Actually i bought an angular admin panel template..which works fine on index.html page..but i need to merge login module too...So i created Login app and merge with their app.. Now i want to pass login rootScope data into index app..and also need separate 'username' entity too..how can i approach too this problem ? – js-hint May 05 '15 at 09:17
0

You can do that using localStorage (HTML5) through angularJS

manasi sakhare
  • 1,051
  • 7
  • 18