jQuery Mobile vs AngularJs page navigation

前端 未结 2 959
栀梦
栀梦 2020-12-31 13:00

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
相关标签:
2条回答
  • 2020-12-31 13:52

    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

    0 讨论(0)
  • 2020-12-31 14:01

    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

    0 讨论(0)
提交回复
热议问题