Angularjs Combat Learning (-)

Source: Internet
Author: User

Angularjs study for some time, a few days ago did a project. After finished want to use only learn angular test water, the results unexpectedly (learning too basic altogether don't know from that, or tangled)

Finally go to MU class net to see "Desert poor Autumn" of "Angularjs actual combat" video only some foundation, hope can let me understand the knowledge.

1, angular 4 core features:

MVC (Clarity of responsibilities, modularity of code)

Modularity (MVC is the means, the ultimate goal is modularity)

The instruction system (ANGULARJS does not go directly to the DOM, it uses the instruction system to process the DOM)

Bidirectional data binding

ANGULARJS-specific instruction system and bidirectional data binding

2, after talking about the 4 big core of things after spending a lot of space to talk about the front-end development needs of the environment, there is a need to see the link

3, controllers (Controller) in the use of the process of attention points

1. Do not attempt to re-use the controller, a director is generally responsible for a small block of views;

2. Do not manipulate the DOM in the controller, which is not the responsibility of the controllers (using the command system);

3. Do not do data formatting in the controller, Ng has a good form control;

4. Do not do data filtering operation in controller, NG has ¥filter service;

5. In general, controllers do not call each other, the controller directly interacts back through the event;

4. Routing

Routing is a very important function of controller;

Using the angular routing feature requires the installation of the routing module ... (The introduction of Angular-route.js is possible)

Definition: Using routing is very easy, and injecting ngroute dependency into our application Mian module is possible.

 var  Bookstoreapp = angular.module (' Bookstoreapp '  ' Ngroute ', ' nganimate ', ' bookstorectrls ', ' bookstorefilters '  function   ($routeProvider) {$routeProvider. When ( '/hello '  ' tpls/hello.html '  contr Oller:  ' Helloctrl ' }. When ( '/list:id ' , {templateurl:  ' tpls/booklist.html '  ' Booklistctrl ' 
       
         '/hello ' 
         
       

Routeprovider Only two methods were when () and otherwise ()

When ()

The When () method has two parameters, we want to match the browser URL and the routing action object. in general, the main route often uses "/" to express, you can also define the URL parameters, in the controller using $routeparams to get the URL parameters.

    • Templateurl: A view template that represents a routed jump

    • Controller: Controllers

otherwise ()

Otherwise () defines the route to jump when the application cannot find a specified route

Angularjs Combat Learning (-)

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.