1 | <!DOCTYPE html>
|
2 | <html lang="en" ng-app="myApp">
|
3 | <head>
|
4 | <meta charset="UTF-8">
|
5 | <title>Welcome bot!</title>
|
6 | <base href="/">
|
7 | <script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.15/angular.js"></script>
|
8 | <script src="https://cdnjs.cloudflare.com/ajax/libs/angular-ui-router/0.2.14/angular-ui-router.js"></script>
|
9 |
|
10 | <script src="/express-turnout.js"></script>
|
11 | <script>
|
12 | angular.module('myApp',['ui.router'])
|
13 | .run(function($rootScope,$window){
|
14 | $rootScope.$on('$viewContentLoaded',function(){
|
15 | var renderedTemplate= document.body.innerHTML.trim().length>0
|
16 | if(renderedTemplate){
|
17 | $window.expressTurnoutRendered();
|
18 | }
|
19 | });
|
20 | })
|
21 | .config(function($locationProvider){
|
22 | $locationProvider.html5Mode(true);
|
23 | })
|
24 | .config(function($stateProvider){
|
25 | $stateProvider.state('second',{
|
26 | url:'/second',
|
27 | template:'<h1>second</h1><a ui-sref="first">first</a>',
|
28 | });
|
29 | $stateProvider.state('first',{
|
30 | url:'*path',
|
31 | template:'<h1>first</h1><a ui-sref="second">second</a>',
|
32 | });
|
33 | })
|
34 | ;
|
35 | </script>
|
36 | </head>
|
37 | <body ui-view></body>
|
38 | </html> |
\ | No newline at end of file |