ANGULARJS Study-First knowledge

Source: Internet
Author: User

Angularjs Definition and characteristics

1.google Front-end open source framework

2.MVVM (Model view View-model) design mode: Model will interact with ViewModel (via $scope object) and will listen to the model changes. These can be sent and rendered by view, and the HTML will show your code.

3. Convenient rest

4. Data binding and Dependency injection

5. Can operate XML-like operations Html,angularjs through its own compiler and directives to complete the relevant settings

6. The template is passed as a DOM element to the angular compiler

7.AngularJS extends the HTML through instructions and binds the data to HTML through an expression .

Building ANGULARJS Applications
  1. Add angular <script> tags to the <src= "//cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.0/angular.min.js" ></script>
  2. Add ng-app directive to <body> tags
    < Body      Ng-app = "Guetonline"      ng-controller= "Maincontroller"    >
  3. Create new directory script and App.js files, define and configure all modules and dependencies in App.js
    var app = Angular.module (' guetonline ', [  ' Ngroute ',  ' Mobile-angular-ui ' ,  ' Mobile-angular-ui.gestures ']);
  4. Define controllers, services, directives in the module app
    function // Controller function // Service function // instruction
  5. Defining routes in the module app
    App. Config (function($routeProvider) {$routeProvider. When ('/', {templateurl: ' Index/home ', Reloadonsearch:false}); $routeProvider. When ('/scroll ', {templateurl: ' scroll.html ', Reloadonsearch:false}); $routeProvider. When ('/toggle ', {templateurl: ' toggle.html ', Reloadonsearch:false}); $routeProvider. When ('/tabs ', {templateurl: ' tabs.html ', Reloadonsearch:false}); $routeProvider. When ('/accordion ', {templateurl: ' accordion.html ', Reloadonsearch:false}); $routeProvider. When ('/overlay ', {templateurl: ' overlay.html ', Reloadonsearch:false}); $routeProvider. When ('/forms ', {templateurl: ' forms.html ', Reloadonsearch:false}); $routeProvider. When ('/dropdown ', {templateurl: ' dropdown.html ', Reloadonsearch:false}); $routeProvider. When ('/drag ', {templateurl: ' drag.html ', Reloadonsearch:false}); $routeProvider. When ('/carousel ', {templateurl: ' carousel.html ', Reloadonsearch:false}); $routeProvider. When ('/news/official_view ', {templateurl: '/news/official_view ', Reloadonsearch:false});});
  6. Cond.. Next step in-depth study 4.5 two steps, and filter

ANGULARJS Study-First knowledge

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.