jQuery Mobile的VS AngularJs页面导航 [英] jQuery Mobile vs AngularJs page navigation

查看:103
本文介绍了jQuery Mobile的VS AngularJs页面导航的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发使用jQuery Mobile和AngularJS混合移动应用程序。

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的

    • 良好的用户界面功能

    • 不要太重量级(与煎茶触摸,例如)


  • 良好的性能和资源管理(缓存,异步请求)

  • 个人经验

我没有什么使用jQuery Mobile的经验,正如我学习,我注意到这两个页面导航机型之间的潜在冲突。

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. 我应该只用一个?

  2. 如果有,哪一个更适合我的需要?

  3. 是否有此设置?
  4. 任何陷阱

非常感谢。

推荐答案

您无法将它们相互比较。

You can't compare them to each other.

Angular.js(如骨干,灰烬如)是其中用于直接在客户端而不是服务器渲染HTML模板/视图MV *框架(用于SPA)。所以,你在你的前端现在有很多应用程序逻辑和框架这都是为了让您的生活更美好,这个编码

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的另一边是一个纯粹的小部件/插件库。阿贾克斯导航插件加载页面(静态的东西,比如HTML)到通过AJAX DOM。所以,你必须$ P $某种程度上对渲染服务器上的这一页。
如果你开始构建一个角度SPA它没有意义使用jQuery Mobile的AJAX导航的。 (如果它是一个原生移动应用你没有服务器反正。)

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.)

当然,你不会得到至今没有一个UI组件库,以便使用您选择(如JQM)之一,但有角的指示工作,以正确初始化上因为$(文件)的DOM元素的插件/小部件。准备好(...)或$(文件)。在(页面加载,...)不知道你的看法角度东西。
看看以下项目:
http://angular-ui.github.io
<一href=\"https://github.com/angular-widgets/angular-jqm\">https://github.com/angular-widgets/angular-jqm

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

这篇关于jQuery Mobile的VS AngularJs页面导航的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆