Skip to content

Commit cf46a38

Browse files
committed
adjust ui-router url
1 parent f5dd505 commit cf46a38

File tree

5 files changed

+18
-15
lines changed

5 files changed

+18
-15
lines changed

app/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<![endif]-->
3131

3232
<!-- Add your site or application content here -->
33-
<div class="container" ng-view=""></div>
33+
<div ui-view></div>
3434

3535
<!-- Google Analytics: change UA-XXXXX-X to be your site's ID -->
3636
<script>

app/scripts/app.js

+14-11
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
'use strict';
22

3-
angular.module('homePageApp', [])
4-
.config(function ($routeProvider) {
5-
$routeProvider
6-
.when('/', {
7-
templateUrl: 'views/main.html',
8-
controller: 'MainCtrl'
9-
})
10-
.otherwise({
11-
redirectTo: '/'
12-
});
13-
});
3+
angular.module('homePageApp',['ui.router'])
4+
.config(function($stateProvider, $urlRouterProvider) {
5+
//
6+
// For any unmatched url, redirect to /state1
7+
$urlRouterProvider.otherwise('/login');
8+
//
9+
// Now set up the states
10+
$stateProvider
11+
.state('state1', {
12+
url: '/state1',
13+
templateUrl: '../views/main.html',
14+
controller:'MainCtrl'
15+
});
16+
});

views/index.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<![endif]-->
2626

2727
<!-- Add your site or application content here -->
28-
<div class="container" ng-view=""></div>
28+
<div ui-view=""></div>
2929

3030
<!-- Google Analytics: change UA-XXXXX-X to be your site's ID -->
3131
<script>
@@ -43,6 +43,6 @@
4343
<script src="bower_components/angular-ui-router/release/angular-ui-router.js"></script>
4444
<script src="scripts/6b865daa.modules.js"></script>
4545

46-
<script src="scripts/223f7039.scripts.js"></script>
46+
<script src="scripts/fc18d422.scripts.js"></script>
4747
</body>
4848
</html>

views/scripts/223f7039.scripts.js

-1
This file was deleted.

views/scripts/fc18d422.scripts.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)