Skip to content

Commit 75f2c0d

Browse files
committed
Implemented gameBoard to application.
Added gameBoard routes etc. to app.js
1 parent e84e443 commit 75f2c0d

File tree

4 files changed

+19
-2
lines changed

4 files changed

+19
-2
lines changed

working/app/Board/gameBoard.html

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<div class="container-fluid"></div>

working/app/Board/gameBoard.js

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
angular.module('app.gameBoard', [])
2+
.controller('boardCtrl', function($scope){
3+
$scope.$watch('html', function() {
4+
$("#container").empty();
5+
$("#container").append($scope.html);
6+
})
7+
$scope.compile = function() {
8+
console.log("You clicked a button!")
9+
}
10+
})
11+

working/app/app.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
angular.module('html_game' , ['ngRoute', 'app.landing', 'app.game'])
1+
angular.module('html_game' , ['ngRoute', 'app.landing', 'app.game', 'app.gameBoard'])
22
.config(function($routeProvider) {
33
$routeProvider.when('/home', {
44
templateUrl: "app/home/home.html",
@@ -10,4 +10,8 @@ angular.module('html_game' , ['ngRoute', 'app.landing', 'app.game'])
1010
controller: "gameCtrl",
1111
controllerAs: "game"
1212
})
13+
.when('/gameBoard', {
14+
templateUrl: "app/Board/gameBoard.html",
15+
controller: "boardCtrl"
16+
})
1317
});

working/index.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
<script src="lib/angular-route/angular-route.js"></script>
1111
<script src="app/app.js"></script>
1212
<script src="app/home/home.js"></script>
13+
<script src="app/Board/gameBoard.js"></script>
1314
<script src="app/game/game.js"></script>
1415
<nav class="navbar navbar-default" role="navigation">
1516
<div class="container-fluid">
@@ -28,7 +29,7 @@
2829
</li>
2930
<ol class="pull-right breadcrumb">
3031
<li><a class="breadcrumb" href=""> Part 1</a></li>
31-
<li><a href="#">Part 2</a></li>
32+
<li><a href="/#gameBoard">Part 2</a></li>
3233
<li class="active">Part 3</li>
3334
</ol>
3435

0 commit comments

Comments
 (0)