0

i new in angularjs.i have same question UI-Router Multiple Views Single Controller response it was stated

You basically need to handle this kind of stuff in some sort of provider (typically a service or a factory) 

You can give an example?

Community
  • 1
  • 1
Denis
  • 13
  • 5
  • You cannot share the same instance of a controller across multiple views because controllers are called with the `new` operator. The Idea to move stuff in `services` resides behind the singleton nature of that recipes... You can share the same service instance because it is singletone – Hitmands May 19 '16 at 10:30
  • You can give you an example? – Denis May 19 '16 at 10:47
  • Services are singleton, so, you should study the singleton pattern... and, of course, the object oriented programming. – Hitmands May 19 '16 at 10:54
  • if I pulled the data from the backend in the controller that I can not bring them to the service . The data will be tightened twice ? – Denis May 19 '16 at 11:01

0 Answers0