How is AngularJS different from jQuery

前端 未结 6 1527
情歌与酒
情歌与酒 2020-11-28 16:51

I only know one js library and that is jQuery.
But my other coders in the group are changing AngularJS as their default library in new project.

I don\'t know any

6条回答
  •  暖寄归人
    2020-11-28 17:47

    1. While Angular 1 was a framework, Angular 2 is a platform. (ref)

    To developers, Angular2 provides some features beyond showing data on screen. 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.

    1. Angular2 emulated 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.

    • The official document site

    • Day one keynote from ng-conf 2016

    • Resource links Original: Basically, jQuery is a great tool for you to manipulate and control DOM elements. 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. (You can use AngularJS for this purpose as well.)

    AngularJS is a framework. It has following features

    1. Two way data binding
    2. MVW pattern (MVC-ish)
    3. Template
    4. Custom-directive (reusable components, custom markup)
    5. REST-friendly
    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)

    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.

    You can use jQuery with AngularJS without any issue.

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

    From FAQ

    Does Angular use the jQuery library?

    Yes, Angular can use jQuery if it's present in your app when the application is being bootstrapped. 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.

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

    Update:

    Angular2 is released. Here is a great list of resource for starters

提交回复
热议问题