-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
215 lines (178 loc) · 7.13 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
<!DOCTYPE html>
<html lang="en" ng-app="demoApp">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!-- main library implementation example -->
<title ng-dynamic-title
root-title="ngDynamicTitle Demo"
sub-title="dynamic page titles in angular 1.x when using ui-router"
>ngDynamicTitle Demo</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/animate.css/3.5.2/animate.min.css">
<!-- code highlighting -->
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.9.1/styles/github.min.css">
</head>
<body>
<!-- github banner -->
<a href="https://github.com/clamstew/ng-dynamic-title" target="_blank" id="fork-me-banner">
<img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png" alt="Fork me on GitHub">
</a>
<div class="container">
<div class="row">
<header ng-controller="rootCntl" class="col-sm-8 col-sm-offset-2">
<br />
<span style="display: block;text-align: center;margin-top: 20px;" ng-class="{'bounce animated': animationClasses}">
<i class="fa fa-arrow-up" aria-hidden="true"></i>
Look at the tab/window title to see this library at work
</span>
<br />
<br />
<div class="jumbotron">
<h1 class="visible-md-block visible-lg-block">ngDynamicTitle</h1>
<h2 class="visible-xs-block visible-sm-block">ngDynamicTitle</h2>
<p>Dynamic page titles in Angular.js 1.x when using ui-router</p>
<p>
<a class="btn btn-primary btn-lg" ui-sref="install" role="button">Install</a>
<!-- <a class="btn btn-default btn-lg" ui-sref="home" role="button">Home</a> -->
<a class="btn btn-default btn-lg" ui-sref="docs" role="button">Docs</a>
</p>
</div>
</header>
<div class="col-sm-8 col-sm-offset-2">
<div ui-view></div>
</div>
<footer class="text-center" style="padding-top: 30px; margin: 30px 0 30px 0;">
<a href="https://twitter.com/clay_stewart" class="twitter-follow-button" data-show-count="false">Follow @clay_stewart</a><script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>
</footer>
</div>
</div>
<!-- setup code highlighting -->
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.9.1/highlight.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.7/angular.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/angular-ui-router/0.3.1/angular-ui-router.min.js"></script>
<script src="//pc035860.github.io/angular-highlightjs/angular-highlightjs.min.js"></script>
<!-- put dist file here -->
<script src="./src/module.js"></script>
<script src="./src/update-page-title-directive.js"></script>
<script type="text/ng-template" id="/install.html">
<p><strong>Bower Install:</strong></p>
<pre>bower install ng-dynamic-title --save</pre>
<p><strong>NPM Install:</strong></p>
<pre>npm i ng-dynamic-title --save</pre>
<p><strong>Add dependencies to your DOM:</strong></p>
<div hljs hljs-no-escape>
<script src="./node_modules/angular/angular.min.js"></script>
<script src="./node_modules/angular-ui-router/release/angular-ui-router.min.js"></script>
<script src="./node_modules/ng-dynamic-title/dist/ng-dynamic-title.min.js"></script>
</div>
</script>
<script type="text/ng-template" id="/documentation.html">
<h3>Documentation</h3>
<strong>basic example html:</strong>
<div hljs hljs-no-escape>
<html ng-app="myAwesomeApp">
<head>
<title ng-dynamic-title
root-title="ngDynamicTitle Demo"
sub-title="Subtitle goes here"
separator="-" <!-- optional and default is '-' -->
separator-tagline="-" <!-- optional and default is '-' -->
>fallback title (tip: recommend it be same as root-title)</title>
</head>
</html>
</div>
<strong>basic example javascript:</strong>
<div hljs hljs-no-escape>
angular.module('myAwesomeApp',[
'ui.router',
'ng.dynamic-title' // <-- Register ngDynamicTitle in main app module
]);
angular.module('myAwesomeApp').config([
'$stateProvider',
'$urlRouterProvider',
function(
$stateProvider,
$urlRouterProvider
) {
$urlRouterProvider.otherwise('home');
$stateProvider
.state('home', {
url: '/home',
template: 'home.html',
data: {
ngDynamicTitle: 'Homepage' // <-- Add data property here
}
});
}
]);
</div>
</script>
<script type="text/javascript">
// setup the demo module
angular.module('demoApp',[
'ui.router',
'hljs',
'ng.dynamic-title'
]);
angular.module('demoApp').config(function (hljsServiceProvider) {
hljsServiceProvider.setOptions({
// replace tab with 4 spaces
tabReplace: ' '
});
});
// setup states for demo
angular.module('demoApp').config([
'$stateProvider',
'$urlRouterProvider',
function(
$stateProvider,
$urlRouterProvider
) {
$urlRouterProvider.otherwise('install');
$stateProvider
.state('home', {
url: '/home',
template: [
'<h3>ngDynamicTitle</h3>',
'<a ui-sref="docs">Docs</button>'
].join(''),
data: {
ngDynamicTitle: 'Homepage'
}
})
.state('install', {
url: '/install',
templateUrl: '/install.html',
data: {
ngDynamicTitle: 'Install'
}
})
.state('docs', {
url: '/docs',
templateUrl: '/documentation.html',
data: {
ngDynamicTitle: 'Documentation'
}
});
}
]);
angular.module('demoApp').controller('rootCntl', [
'$scope',
'$timeout',
function($scope,$timeout) {
function animateMessagePointingOutTitle() {
$scope.animationClasses = true;
$timeout(function() {
$scope.animationClasses = false;
}, 1000);
}
$scope.$on('$stateChangeSuccess', animateMessagePointingOutTitle);
}
]);
</script>
</body>
</html>