opitzconsulting / jquery-mobile-angular-adapter

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

page loading broken when external page is in subfolder #114

Closed marcorinck closed 11 years ago

marcorinck commented 11 years ago

Hi,

I'm trying around with the new route features, sorry, but its hard to understand how to use them correctly with so little documentation.

BUT ... I think I found a bug with page loading when the templateUrl of a route points to an external page that is not in the same folder as the original html. Whats funny is, that it works the first time, but not the 2nd time when using the same link. Its working the 3rd time, but not the 4th and so on.

When the templateUrl is "partials/settings.html", jquery is trying to load "partials/settings" every other time and gets a 404 because it doesn't exist (".html" is missing). If you click again it works. Besides the 404, no other error message happens.

When I use the exact same settings.html in the same folder as original html it works without a problem.

That doesn't happen in internal pages, so no jsFiddle. Route is set like this:

$routeProvider.when('/settings', {
    templateUrl: 'partials/settings.html',
    jqmOptions: {transition: 'slide'}
}); 

The link to open that page is < a href="settings" data-role="button">Settings< /a>

tbosch commented 11 years ago

Hi, yes, I could reproduce this. By the way, for multi page examples, you can use http://plnkr.co.

Tobias

marcorinck commented 11 years ago

Thanks, Tobias! For the hint to plnkr, too! :-)

tbosch commented 11 years ago

Related to jquery mobile changing the base tag when loading a subpage...