Angularjs ngSanitize ngRoute ngAnimate plug-in

Source: Internet
Author: User

Angularjs ngSanitize ngRoute ngAnimate plug-in
Angularjs ngSanitize ngRoute ngAnimate plugin learning points: 1. in Angularjs, ngSanitize2. ngAnimate1. ngSanitize in Angularjs allows the browser to analyze html tags 1. introduce js angular-sanitize.min.js2. introduce the plug-in var app = angular in module. module ("myApp", ['ngsanitize']); 3. use <div ng-bind-html = "text"> </div> to bind data 2. introduction to ngRouteAngularJS routing in Angularjs: The AngularJS routing function is a pure front-end solution, which is not the same as the background routing we are familiar. Backend routing: Different URLs are routed to different controllers and then rendered to pages (HTML ). AngularJS frontend routing requires defining the routing rule (routeProvider) for the specified (ng-app) in advance, and then telling (ng-app) through different URLs) the page (HTML) to be loaded and then rendered to the (ng-app) view (ng-view. AngularJS front-end routing, although the URL input is different, the page display is different. In fact, the partial refreshing of the single page (ng-app) view (ng-view) is completed. In this way, AngularJS is a bit standard for single-page applications. AngularJS routing use: Introduce js dependency injection <script src = "http://cdn.bootcss.com/angular.js/1.2.9/angular-route.min.js"> </script> var m1 = angular. module ('myapp', ['ngroup']); m1.config (['$ routeProvider', function ($ routeProvider) {$ routeProvider. when ('/aaa/: num', {template:' <p> homepage content </p> {name} ', // templateUrlcontroller: 'aaa '}). when ('/ccc', {template: '<p> course content </p> {name}', controller: 'ccc '}). otherwise ({redirectTo: '/Aaa'}) ;}]); Data Display: <div ng-view> </div> $ routeParams: $ on $ routeChangeStart $ routeChangeSuccess/Errorm1.run (['$ rootScope', function ($ rootScope) {$ rootScope. $ on ('$ routeChangeStart', function (event, current, pre) {console. log (event); console. log (current); console. log (pre) ;}) ;}]); page Jump: 1. $ location. path ('aaa/100') 2. <a href = "# div1"> </a> ionic routing plugin https://github.com/angular-ui/ui-router <! Doctype html>

Related Article

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.