6

I'm working on a jQuery/jQuery-mobile based webapp and I was asked to use AngularJS. As expected, I have some problem on handling routing. I know there are lots of people discussing about it, but still I haven't found a working solution.

I have already read this page that someone suggested, but loading first jQuery mobile and then angular doesn't help.

Now I'm taking a look to this library but I'm not sure the company will let me use it, 'cause it's still on alpha stage and my work could became (hopefully) a production webapp. I'm now wondering how can I let JQM handle AngularJS route too, I think this could be the best solution for me.

Has anyone managed it? Can you provide me a working example or another possible solution? Thanks.

3
  • the question is what do you need jQuery for? is it a constraint? Commented Feb 12, 2014 at 13:04
  • It's not up to me, there are some features I did not develop and I can't modify that need JQM Commented Feb 12, 2014 at 13:17
  • do you have to interact with the angular routing with jQuery? you can just programmatically set the page location and you should not have problems Commented Feb 12, 2014 at 16:41

1 Answer 1

2

Best way to solve it is to disable JQM routing, try this:

$.mobile.ajaxEnabled = false;
    $.mobile.linkBindingEnabled = false; 
    $.mobile.hashListeningEnabled = false; 
    $.mobile.pushStateEnabled = false; 
    $.mobile.changePage.defaults.changeHash = false;
Sign up to request clarification or add additional context in comments.

1 Comment

This worked! Thanks. I put this code in my app.config($routeProvider).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.