10

I am developing a hybrid mobile app using jQuery Mobile and AngularJS.

I decided to use a mix of the two for the following:

  1. jQuery Mobile
    • good UI features
    • not too heavyweight (compared to Sencha Touch, for example)
  2. AngularJS
    • good performance and resource management (caching, asynchronous requests)
    • personal experience

I have little to no experience with jQuery Mobile and, as I was learning, I noticed a potential conflict between the page navigation models of the two.

  1. Should I use only one ?
  2. If yes, which one is better suited for my needs ?
  3. Are there any gotchas with this setup ?

Many thanks.

2 Answers 2

13

You can't compare them to each other.

Angular.js (like Backbone, Ember eg.) are MV* Frameworks (for SPA) which used to render html templates/views directly in the client instead of server. So you have a lot of application logic now in your frontend and this Frameworks are made to make your life better, coding this.

jQuery Mobile on the other side is a pure widget/plugin library. The AJAX navigation plugin load pages (something static, like html) into the DOM via AJAX. So you have to pre-render this pages on the server somehow. If you started to build a SPA with Angular it doesn't make sense to use jQuery Mobile's AJAX navigation at all. (If it's a native mobile app you have no server anyway.)

Sure, you won't get far without an UI component library so use one of your choice (eg. jQM) but work with Angular's directives to init the plugins/widgets correctly on your DOM elements since a $(document).ready(...) or a $(document).on( "pageload", ... ) doesn't know anything about your Angular views. Take a look at following projects: http://angular-ui.github.io https://github.com/angular-widgets/angular-jqm

Sign up to request clarification or add additional context in comments.

2 Comments

so angular is better?
@Matian2049 real savage :D
-1

This has been already addressed in HERE

Basically the article states that trying to intercept the navigation from angular can be painful, so leave all the routing jqm

Comments

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.