opitzconsulting / jquery-mobile-angular-adapter

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

resolve not working in routeProvider #172

Closed asgeo1 closed 11 years ago

asgeo1 commented 11 years ago

I'm trying to inject some data into my controller via the 'resolve' feature of the angularjs router. It's not working, I suspect because the jquery-mobile-angular-adapter does not support this?

I created a plunk here:

http://plnkr.co/edit/mMHH7J6AWMx0Q6VxLIzw

Have I done something wrong, or is this just not supported in the jqm-ng-adapter ?

tbosch commented 11 years ago

Hi, with the jqm adapter, you can't inject properties form resolve into the constructor function of the controller, as pages and their controllers may be cached. Please use the onActivate feature instead. Have a look here: http://plnkr.co/edit/1LB01Rlz551uNHVKjgMb

There are more details in the Readme.md: https://github.com/tigbro/jquery-mobile-angular-adapter#navigation-and-routes

Does this solve your problem? Tobias

tbosch commented 11 years ago

Hope this helped. Closing this.