forked from kangki/algorithmJS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
53 lines (42 loc) · 1.33 KB
/
index.html
File metadata and controls
53 lines (42 loc) · 1.33 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<!DOCTYPE html>
<html lang="ko" ng-app="app">
<head>
<meta charset='utf-8'>
<title>Algorithm</title>
<link rel="icon" href="favicon.ico">
<script type="text/javascript" src="lib/angular.min.js"></script>
<script type="text/javascript" src="lib/angular-route.min.js"></script>
<script type="text/javascript">
var app = angular.module('app',['ngRoute']);
app.config(function($routeProvider, $locationProvider){
$routeProvider
.when('/main', {templateUrl:'main.html', controller:'routeCtrl'})
.when('/stack', {templateUrl:'stack.html', controller:'routeCtrl'})
.otherwise({redirectTo:'/main.html'});
$locationProvider.html5Mode(false);
});
app.controller('routeCtrl', function($scope){
});
app.controller('menuCtrl', function($scope, $route, $routeParams, $location){
this.$route = $route;
this.$location = $location;
this.$routeParams = $routeParams;
});
</script>
</head>
<body ng-controller="menuCtrl as menu">
<header>
<ul>
<li><a href="#/main">main</a></li>
<li><a href="#/stack">stack</a></li>
</ul>
</header>
<div ng-view></div>
<footer>
<pre>$location.path() = {{menu.$location.path()}}</pre>
<pre>$route.current.templateUrl = {{menu.$route.current.templateUrl}}</pre>
<pre>$route.current.params = {{menu.$route.current.params}}</pre>
<pre>$routeParams = {{menu.$routeParams}}</pre>
</footer>
</body>
</html>