What is the difference between the Ngroute (Angular-route.js) and the Ui-router (angular-ui-router.js) modules?Many articles say that Ngroute used $routeprovider when routing configuration, but used $stateProvider and $urlRouterProvider when
What is the difference between the Ngroute (Angular-route.js) and the Ui-router (angular-ui-router.js) modules?Many articles say that Ngroute used $routeprovider when routing configuration, but used $stateProvider and $urlRouterProvider when
Angular uses ui-router to design web pages, angularui-router
Author: Songyang
This article is from Ashura road and is prohibited for commercial purposes. For more information, see the source.
Link: http://blog.csdn.net/fansongy/article/details/44162685
What is this?
Ngroute and Ui-router are not two separate parts, Ui-router is a community library to improve the functionality of Ngroute, can be used in multi-view (nested), the function is very powerful!To fully understand the differences between the two, here I will add the $http request to compare the two,1. Introduction of the f
: '/page2 ', Templateurl: ' Nestedviews/htmls/2/page2.html ', CO Ntroller:function ($sCope, $state) {$scope. Change = function () {$state. Go ();
}
}
})
}); App.controller (' Maincontroller ', function () {alert ("Welcome to Nested View demo!");
In the preceding code, a nested view is set, the state 1--> state 1.1--> State 1.1.1, and the state name of the previous view must precede the child view state name plus '. ', such as Father.child
system based on angular development needs to deal with the following situations in terms of authority control:
1, the UI, the user's corresponding role permissions can access which pages can not access which pages;
2, the reason, when the user is ready to jump to a page, if there is no access to the page, redirect to a false hint page;
as follows, by setting the Ui-sref to navigate to the corresponding Page1, etc.:Div> Div> spanstyle= "width:100px"Ui-sref= ". Page1">ahref="">Page1a>span> spanstyle= "width:100px"Ui-sref= ". Page2">ahref="">Page2a>span> spanstyle= "width:100px"Ui-sref= ". Page3">ahref="">Page3a>span> Div> Div> DivU
will assume that the page is Ui-view or embedded in the page, which is the page that needs to be displayed in the routing configuration. The is delimited with a. Number. This is key, it tells the routing engine what we define here is a sub-page or an embedded page.
New page1.html page2.html page3.htmlThe other 2 are shown above.
Introduce angular-
system based on angular development needs to deal with the following situations in terms of authority control:
1, the UI, the user's corresponding role permissions can access which pages can not access which pages;
2, the reason, when the user is ready to jump to a page, if there is no access to the page, redirect to a false hint page;
Ui-router ' s states and AngularJS directives have much in common. Let's explores the similarities between the and how these patterns has emerged in Angular. Keeping your states and directives consistent can also help with refactoring as your apps grows larger over time.Angular.module (' app ', [' ui.router ', ' ui.bootstrap ']). config (' Home ',function($stateP
called, for example:$stateProvider. State ("Home", {URL: "/", Templateurl: "tmpls/home.html", Controller:function ($scope, $state) { Console.log ("Enter Home");})Each time the status changes to home, a log is output.Finally, the rendering is hierarchically based. Therefore, changing the sibling node does not render the parent node again. And will not be re-rendered without changing the state. For example, always press the same button, it will not be re-rendered; no change with node, click a "Re
This series explores the routing mechanism of ANGULARJS, which is developed under Webstorm.The ANGULARJS Routing series includes:1. Angularjs Routing Series (1)--Basic routing configuration2. Angularjs Routing Series (2)--Refresh, view routes, route events and URL formats, get route parameters, Route resolve3. Angularjs Routing Series (3)--Ui-
A @Directive can also listen to events on their host element using @HostListener . This allows your to add behaviors, react to user input and update or modify properties on the element without have to Create a custom component.Import {Directive, Hostlistener, hostbinding, Input} from '@angular/core'; @Directive ({selector:'[clickable]'}) Exportclassclickabledirective {@Input ('clickable') text; @HostBinding ()GetInnerText () {if( This. Text) { re
Opencv experiences (1)
The second chapter of learning opencv mainly introduces some common and interesting functions and data types, so that students at the beginning are more interested in image processing, although I do not understand the internal experiment of the function and the meaning of some defined constants, I am still very happy after learning Chapter 2. At least I know some basics of image processing, such as contour processing;
Knowledge
Chapter 3 UI cornerstone-UI layout (2), ui cornerstone3.2 Layout 3.2.1a brief introduction to Layout s
Generally, an Android view contains many controls. To make the interface reasonable and beautiful, we need to arrange them on the interface according to our design ideas. T
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.