Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
111 views
in Technique[技术] by (71.8m points)

javascript - AngularJS与jQuery有何不同(How is AngularJS different from jQuery)

I only know one js library and that is jQuery .

(我只知道一个js库,那就是jQuery 。)


But my other coders in the group are changing AngularJS as their default library in new project.

(但是我小组中的其他编码人员正在将AngularJS更改为新项目中的默认库。)

I don't know anything about it.

(我对此一无所知。)

How is it different from jQuery?

(与jQuery有何不同?)


I already have a set of functions done for similar tasks in jQuery.

(我已经为jQuery中的类似任务完??成了一组功能。)

Can I still use jQuery stuff with AngularJS?

(我还能在AngularJS中使用jQuery吗?)

  ask by user825904 translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
  1. While Angular 1 was a framework, Angular 2 is a platform .

    (Angular 1是一个框架,而Angular 2是一个平台 。)

    ( ref )

    (( 参考 ))

To developers, Angular2 provides some features beyond showing data on screen.

(对于开发人员来说,Angular2提供了一些功能,除了在屏幕上显示数据。)

For example, using angular2 cli tool can help you "pre-compile" your code and generate necessary javascript code ( tree-shaking ) to shrink the download size down to 35Kish.

(例如,使用angular2 cli工具可以帮助您“预编译”您的代码并生成必要的javascript代码( 摇树 )以将下载大小减小到35Kish。)

  1. Angular2 emulated Shadow DOM.

    (Angular2模拟了Shadow DOM。)

    ( ref )

    (( 参考 ))

This opens a door for server rendering that can address SEO issue and work with Nativescript etc that don't work on browsers.

(这为服务器渲染打开了一扇门,它可以解决SEO问题并可以与在浏览器上不起作用的Nativescript等一起使用。)

  • The official document site

    (官方文件网站)

  • Day one keynote from ng-conf 2016

    (ng-conf 2016的第一天主题演讲)

  • Resource links Original: Basically, jQuery is a great tool for you to manipulate and control DOM elements.

    (资源链接 原始内容:基本上,jQuery是一个不错的工具,可用于您操纵和控制DOM元素。)

    If you only focus on DOM elements and no Data CRUD, like building a website not web application, jQuery is the one of the top tools.

    (如果只关注DOM元素而不关注Data CRUD,例如构建网站而不是Web应用程序,则jQuery是顶级工具之一。)

    (You can use AngularJS for this purpose as well.)

    ((您也可以为此使用AngularJS。))

AngularJS is a framework .

(AngularJS是一个框架 。)

It has following features

(具有以下特点)

  1. Two way data binding

    (双向数据绑定)

  2. MVW pattern (MVC-ish)

    (MVW模式(MVC-ish))

  3. Template

    (模板)

  4. Custom-directive (reusable components, custom markup)

    (自定义指令(可重用组件,自定义标记))

  5. REST-friendly

    (REST友好)

  6. Deep Linking (set up a link for any dynamic page)

    (深度链接(为任何动态页面设置链接))

  7. Form Validation

    (表格验证)

  8. Server Communication

    (服务器通讯)

  9. Localization

    (本土化)

  10. Dependency injection

    (依赖注入)

  11. Full testing environment (both unit, e2e)

    (完整的测试环境(单元,e2e))

check this presentation and this great introduction

(查看此演示文稿出色的介绍)

Don't forget to read the official developer guide

(别忘了阅读官方开发人员指南)

Or learn it from these awesome video tutorials

(或从这些很棒的视频教程中学习)

If you want to watch more tutorial video, check out this post, Collection of best 60+ AngularJS tutorials .

(如果您想观看更多教程视频,请查看此帖子, 精选的60多个AngularJS教程 。)

You can use jQuery with AngularJS without any issue.

(您可以将jQuery与AngularJS一起使用,不会出现任何问题。)

In fact, AngularJS uses jQuery lite in it, which is a great tool.

(实际上,AngularJS在其中使用了jQuery lite,这是一个很棒的工具。)

From FAQ

(从常见问题)

Does Angular use the jQuery library?

(Angular是否使用jQuery库?)

Yes, Angular can use jQuery if it's present in your app when the application is being bootstrapped.

(是的,如果在引导应用程序时Angular出现在您的应用程序中,则可以使用jQuery。)

If jQuery is not present in your script path, Angular falls back to its own implementation of the subset of jQuery that we call jQLite.

(如果您的脚本路径中不存在jQuery,则Angular会退回到它自己的jQuery子集(我们称为jQLite)的实现。)

However, don't try to use jQuery to modify the DOM in AngularJS controllers, do it in your directives.

(但是,请勿尝试使用jQuery来修改AngularJS控制器中的DOM,请在您的指令中进行操作。)

Update:

(更新:)

Angular2 is released.

(Angular2发布了。)

Here is a great list of resource for starters

(是适合初学者的大量资源清单)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...