-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.html
More file actions
29 lines (28 loc) · 836 Bytes
/
test.html
File metadata and controls
29 lines (28 loc) · 836 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>angularJS test</title>
<script src="angular-1.4.1/angular.min.js"></script>
<script src="angular-1.4.1/angular-route.js"></script>
</head>
<body ng-app="myApp">
<h2>angularJS route</h2>
<ul>
<li><a href="#/">index</a></li>
<li><a href="#/computers">computers</a></li>
<li><a href="#/printers">printers</a></li>
<li><a href="#/blabla">others</a></li>
</ul>
<div ng-view></div>
<script>
angular.module('myApp', ['ngRoute']).config(['$routeProvider', function($routeProvider){
$routeProvider
.when('/',{template:"this is index page"})
.when('/computers',{template:"this is computer page"})
.when('/printers',{template:"this is printers page"})
.otherwise({redirectTo:'/'})
}]);
</script>
</body>
</html>