从jQuery的/ jQuery Mobile的移动到AngularJS [英] Moving from jQuery/jQuery Mobile to AngularJS

查看:149
本文介绍了从jQuery的/ jQuery Mobile的移动到AngularJS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的移动应用程序是目前jQuery的/ jQuery Mobile的严重依赖 - 以至于我几乎每一个DOM操作,穿越我的数据集,以及大量使用jQuery的动画 - 因为它是那么容易做到的。

我还使用jQuery Mobile作为核心框架,因为它是移动友好,给你一个直接的接口外的开箱(尽管是pretty基础,通用的看着接口)。

几乎所有的移动开发者我已经谈过关于赞不绝口约AngularJS;我认为随着网络的普及jQuery Mobile的似乎获得,这将是大部分的选择 - 但我很惊讶地了解到,很少有开发人员使用它,并且选择了AngularJS路线

演示我一直在使用AngularJS看到似乎并没有表现出一个伟大的外观和感觉 - 如果有的话,他们不显示任何种类的造型

从远程数据进我们的应用程序下载JSON和做各种事情吧。

于是几个问题:


  1. 这是什么AngularJS所提供的 - 我已经看到似乎是最初的东西来显示它看上去很基本的

  2. 是不是的更好的比jQuery的?是两个可比性?

  3. 我会使用它获得什么好处?

的jQuery的一个缺点是,它是相当笨拙 - 这是一个有点慢(等待时的事情来初始化你真的看到一个滞后)。我打算读O'Reilly的AngularJS( http://shop.oreilly.com/product/0636920028055。不要) - 希望这会告诉我一些好处 - 但尽管如此,第一章并没有真正表现出很多好处


解决方案

这个问题已经被问。请参阅:

现在回答你的问题,特别是:


  1. 作为链接回答,AngularJs是一个开发框架,而jQuery是靶向DOM操作

  2. 他们没有可比性。我使用JQuery在我AngularJs解决方案来操作DOM(以指令)

  3. 这是一个相当复杂的问题。我会回答它在下一行

我不知道,如果你将获得好处,但很多人发现,他们这样做(我目前的房子框架AngularJs迁移应用程序架构从,我认为好处是显而易见的。


  • 更好code结构

  • 分离效果更好的担忧

我觉得你应该先明白为什么有这么多MV *的JavaScript在那里(MV *框架列表)和这个问题,他们设法解决。

注:我是一个C#开发人员,我没有办法在这方面的权威,刚开始,在过去6个月的工作角

My mobile app is heavily reliant on jQuery/jQuery Mobile at the moment - so much so that I do practically every DOM manipulation, traversing my datasets, and lots of animations using jQuery - because it's so easy to do.

I also use jQuery Mobile as the core framework since it's mobile friendly and gives you an interface straight out-of-the-box (albeit a pretty basic, generic looking interface).

Nearly EVERY mobile developer I have spoken to raves on about AngularJS; I thought with the popularity jQuery Mobile seems to be gaining, that would be the choice of most - but I was surprised to understand that very few developers use it, and opt for the AngularJS route.

Demos I have seen using AngularJS don't seem to show a great look and feel - if anything, they don't show any sort of styling.

Our app downloads JSON from a remote data-feed and does various things with it.

So a few questions:

  1. What does AngularJS have to offer - the initial things I have seen seemed to show it looking quite basic?
  2. Is it better than jQuery? Are the two comparable?
  3. Would I gain any benefits from using it?

One downside of jQuery is that it is quite clunky - and it's a bit slow (you really notice a lag when waiting for things to initialise). I intend to read O'Reilly's AngularJS (http://shop.oreilly.com/product/0636920028055.do) - hopefully that'll show me some benefits - but still, the first chapter didn't really show many benefits.

解决方案

This question was already asked. Please see:

Now to answer your question in particular:

  1. As answered in the link, AngularJs is a development framework while JQuery is a library that targets DOM manipulation
  2. They are not comparable. I use JQuery in my AngularJs solution to manipulate the DOM (in directives)
  3. This is quite a complicated question. I will answer it in the next lines

I am not sure if you would gain benefits but many find that they do (I am currently migrating an application architecture from a in house framework to AngularJs and I think the benefits are obvious

  • better code structure
  • better separation of concerns

I think you should first understand why there are so many MV* JavaScript out there (list of mv* frameworks) and the problem they try to solve.

Note: I am a C# developer and I am in no way an authority on the subject, just started to work on Angular in the last 6 months.

这篇关于从jQuery的/ jQuery Mobile的移动到AngularJS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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