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
- Add angular <script> tags to the <src= "//cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.0/angular.min.js" ></script>
- Add ng-app directive to <body> tags
< Body Ng-app = "Guetonline" ng-controller= "Maincontroller" >
- 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 ']);
- Define controllers, services, directives in the module app
function // Controller function // Service function // instruction
- 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});});
- Cond.. Next step in-depth study 4.5 two steps, and filter
ANGULARJS Study-First knowledge