opitzconsulting / jquery-mobile-angular-adapter

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

shared-controller functionality combined with $navigate("#myPage", "sharedCtrl.function") #91

Closed pascalwhoop closed 11 years ago

pascalwhoop commented 11 years ago

Hey there. I noticed using a shared Ctrl together with your $navigate functionality is somewhat tricky.

If I try to call a function from a shared controller via the $navigate like this:

$navigate("#detailPage", "listsCtrl.setDetailItem")

It seems it only works with regular (angular) controllers however not with shared ones.

Just wanted to point it out. Would be a great thing to have. Pascal

tbosch commented 11 years ago

Hi, $navigate is gone, but there are new function on $location instead. Migration guide: https://github.com/tigbro/jquery-mobile-angular-adapter/blob/master/Changelog.md

Also, the onActivate property on routes is now an expression, i.e. this can call also functions in a shared controller.

Here is a jsfiddle that uses a shared controller on the new onActivate expression: http://jsfiddle.net/FL5Wf/7/ Tobias