opitzconsulting / jquery-mobile-angular-adapter

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

attempting to load same route with different parameters not working #119

Closed savagepanda closed 11 years ago

savagepanda commented 11 years ago

I have a route setup like /test/:param

thus I can call the page using

<a href="test/test1">test1</a>

this works fine. inside the result page, if i put a link to

<a href="test/test2">test2</a>

this is ignored, and navigation does not occur. Any ideas on why?

Here's a jsfiddle to illustrate the issue http://jsfiddle.net/JUwEr/

savagepanda commented 11 years ago

I think the issue maybe that in onRouteChangeSuccess in line 1207, the $route.ngmTemplateUrl, which is taken as the URL has only the initial route. The rest of the parameters are parsed out and sitting in the $route.params or $route.pathParams The absolute path is also available in the $document or $location services, but not used.

savagepanda commented 11 years ago

I've been unable to track down the issue, I think the last comment I made is in error, on normal working calls, the url also does not contain the path info either.. Somehow the path is getting lost somewhere in the adapter.. Do you have any ideas?

tbosch commented 11 years ago

Hi, templates in folders are buggy right now due to the dynamic base tag of jquery mobile, see here: #114

How it should work: In your template in the folder "test/test1" you should be able to link to a page with templateUrl "test/test2" just by using <a href="test2"> without specifying the path.

Workaround: Use absolute paths everywhere, e.g. "/test/test1" if your project runs under "/" in your webserver.

Tobias

tbosch commented 11 years ago

Here is an updated jsfiddle for 1.2.1-SNAPSHOT, http://jsfiddle.net/JUwEr/1/