opitzconsulting / jquery-mobile-angular-adapter

jquery mobile angular adapter
MIT License
517 stars 114 forks source link

All controllers created at the same time #169

Closed mato2000 closed 11 years ago

mato2000 commented 11 years ago

I've got multiple pages in the same html, and each one associated to a different controller. Each controller calls to a service. When the app starts, all controllers are being instantiated, and therefore calls to the service which produce undesirable behaviour. I thought each controller was created when the page is loaded. is that right? if not, is there a way to workaround this?

tbosch commented 11 years ago

Hi, all controllers in a page are created right when the app starts. If you have external files and are using controllers in them, only they will get created the first time the page is visited.

If you want to do some work when the page is loaded, you have 2 options:

Tobias

mato2000 commented 11 years ago

Oh, Ok. I think I can use ngm-pagebeforeshow for getting specific page data. Many Thanks! Matias.