Skip to content

Commit 675d084

Browse files
committed
adds controllers and state
1 parent 12ac8be commit 675d084

File tree

11 files changed

+27
-7
lines changed

11 files changed

+27
-7
lines changed

app/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040
<script src="js/core/controllers/AppCtrl.js"></script>
4141

4242
<!-- MAIN -->
43+
<script src="js/main/state.js"></script>
4344
<script src="js/core/controllers/NavbarCtrl.js"></script>
44-
<script src="js/core/controllers/MainCtrl.js"></script>
4545

4646
</body>
4747
</html>

app/js/core/state.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ app.config(['$stateProvider', function($stateProvider) {
1111
controller: 'NavbarCtrl'
1212
},
1313
'main': {
14-
templateUrl: 'js/core/templates/main.tpl.html',
15-
controller: 'MainCtrl'
14+
templateUrl: 'js/core/templates/main.tpl.html'
1615
}
1716
}
1817
})
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
<div class="container">
33
<div class="row">
4-
<h1>This is the main container</h1>
4+
<div ui-view></div>
55
</div>
66
</div>

app/js/main/controllers/AboutCtrl.js

Whitespace-only changes.

app/js/main/controllers/ContactCtrl.js

Whitespace-only changes.

app/js/main/controllers/HomeCtrl.js

Whitespace-only changes.

app/js/main/controllers/MainCtrl.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

app/js/main/state.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Application Level State
2+
app.config(['$stateProvider', function($stateProvider) {
3+
4+
$stateProvider
5+
.state('app.home', {
6+
url: '/home',
7+
templateUrl: 'js/main/templates/home.tpl.html',
8+
controller: 'HomeCtrl'
9+
})
10+
.state('app.about', {
11+
url: '/about',
12+
templateUrl: 'js/main/templates/about.tpl.html',
13+
controller: 'AboutCtrl'
14+
})
15+
.state('app.contact', {
16+
url: '/contact',
17+
templateUrl: 'js/main/templates/contact.tpl.html',
18+
controller: 'ContactCtrl'
19+
});
20+
21+
}]);
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<div>This is about</div>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<div>This is contact</div>

0 commit comments

Comments
 (0)