Examples of specific wording:
1.js defines a controller
function Myctrl ($scope, $location) {
$scope. Jumptourl = function (path) {
//todo:add code here
};
}
2.html Inside Application Controller
<div ng-controller= ' Myctrl ' >
<button ng-click= "Jumptourl ('/signin ')" >signin</button>
</div>
3.controller inside the TODO position fill in
Then you can run it and see the effect.
Suppose the URL of the current page is: Http://127.0.0.1:8080/#/home
$location. Path (path); After execution, it jumps to http://127.0.0.1:8080/#/signin.
If you find that the page does not jump normal, you can $location.path(path);
add a sentence in the following
var cururl = $location. Absurl (); Use to display URL full path
When you debug the trace page to see how much the Cururl value becomes, you can probably guess what the problem is.
Well, the above is in ANGULARJS use controller complete URL jump all the content, I hope this article for everyone to learn Angularjs help.