0

I have a directive, that in its scope has an object. This is static information right now and I want to make this visible for every controller in my app. Is there any way to do this?

Jonathan Hall
  • 75,165
  • 16
  • 143
  • 189
squeezy00
  • 3
  • 3
  • 1
    Create service to share the object, you can access it after inject with any controller or directive. See https://stackoverflow.com/questions/21919962/share-data-between-angularjs-controllers – Sachink Apr 16 '18 at 13:33
  • This worked perfectly, thanks! – squeezy00 Apr 16 '18 at 13:41

1 Answers1

0

Use global scope ($rootScope ) for example, if you want to use it everywhere

UPDATE: some example and answer here: How do I use $rootScope in Angular to store variables?

Sh. Pavel
  • 1,584
  • 15
  • 28