Angularjs (1)

Source: Internet
Author: User

The 1.angularjs is: https://angularjs.org

2. What is Angularsjs???? Angularjs is an extension of HTML that absorbs the traditional MVC fundamentals, separates the model that manages the data, the application logic code (Controller), and the code that shows the data to the user (view). In order to solve the static Web page technology to build dynamic application of the shortcomings, while eliminating some cumbersome DOM operation and event monitoring operations.

Key features of the 3.ANGULARJS:

1) Data binding: It is simply a mapping between a part of the UI and certain JavaScript properties. In the traditional situation, we need to modify the DOM manually, and then show these changes, and when the data binding, the interface operation can be real-time response to the data, the data changes can be reflected in real-time interface display.

2) Dependency Injection: In the example above, Somecontroller can get the $scope object it needs without creating it. Of course, we can also customize some of the services to be injected into the controller that needs to be used. In short, our class simply needs to get what it needs without having to create what it depends on. It is emphasized here that dependency injection needs to follow the formal rules above to prevent code compression from generating errors.

3) directive: is one of the most powerful functions of ANGULARJS, is the core part of the HTML extension, the above example {{}},ngcontroller all belong to the directive, {{}} implements the data binding, Ngcontroller implements the Controller view control. Angularjs has a lot of instructions built in to help us define the view, and we can also customize the instructions to achieve the required functionality.

<!DOCTYPE HTML><HTMLNg-app= "MyTest"><Head><MetaCharSet= "Utf-8"><Scriptsrc= "Http://apps.bdimg.com/libs/angular.js/1.4.6/angular.min.js"></Script></Head><Body>    <DivNg-controller= "Somecontroller">        <Hello></Hello> //     </Div>    <Script>        varmyTest=Angular.module ("myTest", []); Mytest.directive ("Hello", function() {            return{restrict:"E", Template:"", replace:true            };    }); </Script></Body></HTML>

4) Filter: The Received value is processed by some rule, and the result after processing is returned. The built-in filters are: currency (currency), date (date), JSON (formatted JSON object), lowercase (lowercase), uppercase (uppercase), LimitTo (number of limits), number (formatted numbers), Order by (sort), filter (matching substring). At the same time, we can also customize the filter as needed.

5) Routing: A deep link between the controller, the view template, and the browser's current address bar information. In an application, you can create a route by invoking a function on the $routeprovider service, passing the route you need to create as a configuration block to these functions. It is also because of the presence of a route that we do not put everything in one main view, but rather create a layout module and then use this module to accommodate other things, while the ng-view instruction tells angular where to display the views. In real-world development, angular's built-in routing ngroute is rarely used, but a third-party routing module based on Ngroute development is used Ui.router, where a post is shared http://www.html-js.com/article/ Front-end-source-code-analysis-original-uirouter-source-code-analysis

Angularjs (1)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.