-
Notifications
You must be signed in to change notification settings - Fork 50
/
index.html
75 lines (71 loc) · 2.51 KB
/
index.html
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<!DOCTYPE html>
<html>
<head>
<title>犀鸟</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="img/bird.png">
<link rel="stylesheet" href="lib/bootstrap.min.css"/>
<link rel="stylesheet" href="lib/codemirror.css"/>
<script src="lib/angular.min.js"></script>
<script src="lib/angular.ngRoute.js"></script>
<style type="text/css">
body {
padding-bottom: 40px;
}
.error {
color: #815ba4;
}
</style>
</head>
<body>
<div class="container" ng-app="Bird">
<h1><a href="#/"><img src="img/bird.png" /></a>犀鸟</h1>
<div ng-view></div>
<footer>
<div class="site-info">
<a href="/#about">关于犀鸟</a>
Copyright © 2013. Create By <a href="mailto:[email protected]">danghongyang</a> </div>
</footer>
</div>
<script src="js/Index.js"></script>
<script src="js/Add.js"></script>
<script src="js/Api.js"></script>
<script src="js/About.js"></script>
<script>
var app = angular.module("Bird", ["ngRoute"]);
app.config(['$routeProvider',
function ($routeProvider) {
$routeProvider.
when('/', {
templateUrl: 'html/index.html',
controller: 'Index'
}).when('/add', {
templateUrl: 'html/add.html',
controller: 'Add'
}).when('/add/:href', {
templateUrl: 'html/add.html',
controller: 'Add'
}).when('/api/:href', {
templateUrl: 'html/api.html',
controller: 'Api'
}).when('/api/:href/:name', {
templateUrl: 'html/api.html',
controller: 'Api'
}).when('/about', {
templateUrl: 'html/about.html',
controller: 'About'
}).otherwise({
redirectTo: '/'
});
}]);
app.run(function($rootScope, $location, $anchorScroll, $routeParams) {
//when the route is changed scroll to the proper element.
$rootScope.$on('$routeChangeSuccess', function(newRoute, oldRoute) {
$location.hash($routeParams.scrollTo);
$anchorScroll();
});
});
</script>
</body>
</html>