Skip to content

Commit

Permalink
Added rngviewer route
Browse files Browse the repository at this point in the history
  • Loading branch information
geekuillaume committed Mar 26, 2014
1 parent 0b750d7 commit 68cbc3e
Show file tree
Hide file tree
Showing 11 changed files with 47 additions and 11 deletions.
6 changes: 4 additions & 2 deletions app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
<!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
<!-- build:css styles/vendor.css -->
<!-- bower:css -->
<link rel="stylesheet" href="bower_components/sass-bootstrap/dist/css/bootstrap.css">
<link rel="stylesheet" href="bower_components/sass-bootstrap/dist/css/bootstrap.css" />
<!-- endbower -->
<!-- endbuild -->
<!-- build:css({.tmp,app}) styles/main.css -->
<link rel="stylesheet" href="styles/main.css">
<!-- endbuild -->
</head>
<body ng-app="chickenRandApp">
<body ng-app="webAppApp">
<!--[if lt IE 7]>
<p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
<![endif]-->
Expand Down Expand Up @@ -48,6 +48,7 @@
<script src="bower_components/jquery/jquery.js"></script>
<script src="bower_components/angular/angular.js"></script>
<script src="bower_components/sass-bootstrap/dist/js/bootstrap.js"></script>
<script src="bower_components/angular-resource/angular-resource.js"></script>
<script src="bower_components/angular-cookies/angular-cookies.js"></script>
<script src="bower_components/angular-sanitize/angular-sanitize.js"></script>
<script src="bower_components/angular-route/angular-route.js"></script>
Expand All @@ -57,6 +58,7 @@
<!-- build:js({.tmp,app}) scripts/scripts.js -->
<script src="scripts/app.js"></script>
<script src="scripts/controllers/main.js"></script>
<script src="scripts/controllers/rngviewer.js"></script>
<!-- endbuild -->
</body>
</html>
6 changes: 5 additions & 1 deletion app/scripts/app.coffee
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
'use strict'

angular.module('chickenRandApp', [
angular.module('webAppApp', [
'ngCookies',
'ngResource',
'ngSanitize',
'ngRoute'
])
Expand All @@ -10,5 +11,8 @@ angular.module('chickenRandApp', [
.when '/',
templateUrl: 'views/main.html'
controller: 'MainCtrl'
.when '/rngviewer',
templateUrl: 'views/rngviewer.html'
controller: 'RngviewerCtrl'
.otherwise
redirectTo: '/'
2 changes: 1 addition & 1 deletion app/scripts/controllers/main.coffee
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

angular.module('chickenRandApp')
angular.module('webAppApp')
.controller 'MainCtrl', ($scope) ->
$scope.awesomeThings = [
'HTML5 Boilerplate'
Expand Down
9 changes: 9 additions & 0 deletions app/scripts/controllers/rngviewer.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
'use strict'

angular.module('webAppApp')
.controller 'RngviewerCtrl', ($scope) ->
$scope.awesomeThings = [
'HTML5 Boilerplate'
'AngularJS'
'Karma'
]
2 changes: 1 addition & 1 deletion app/views/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<li><a ng-href="#">About</a></li>
<li><a ng-href="#">Contact</a></li>
</ul>
<h3 class="text-muted">ChickenRand</h3>
<h3 class="text-muted">WebApp</h3>
</div>

<div class="jumbotron">
Expand Down
1 change: 1 addition & 0 deletions app/views/rngviewer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<p>This is the rngviewer view.</p>
3 changes: 2 additions & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
{
"name": "chicken-rand",
"name": "web-app",
"version": "0.0.0",
"dependencies": {
"angular": "1.2.6",
"json3": "~3.2.6",
"es5-shim": "~2.1.0",
"jquery": "~1.10.2",
"sass-bootstrap": "~3.0.2",
"angular-resource": "1.2.6",
"angular-cookies": "1.2.6",
"angular-sanitize": "1.2.6",
"angular-route": "1.2.6"
Expand Down
1 change: 1 addition & 0 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ module.exports = function(config) {
files: [
'app/bower_components/angular/angular.js',
'app/bower_components/angular-mocks/angular-mocks.js',
'app/bower_components/angular-resource/angular-resource.js',
'app/bower_components/angular-cookies/angular-cookies.js',
'app/bower_components/angular-sanitize/angular-sanitize.js',
'app/bower_components/angular-route/angular-route.js',
Expand Down
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "chickenrand",
"name": "webapp",
"version": "0.0.0",
"dependencies": {},
"devDependencies": {
Expand Down Expand Up @@ -28,10 +28,9 @@
"jshint-stylish": "~0.1.3",
"load-grunt-tasks": "~0.2.0",
"time-grunt": "~0.2.1",
"karma-ng-html2js-preprocessor": "^0.1.0",
"karma-ng-scenario": "^0.1.0",
"grunt-karma": "^0.8.2",
"karma": "^0.12.1",
"karma-ng-html2js-preprocessor": "^0.1.0"
"grunt-karma": "^0.8.2"
},
"engines": {
"node": ">=0.8.0"
Expand Down
2 changes: 1 addition & 1 deletion test/spec/controllers/main.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
describe 'Controller: MainCtrl', () ->

# load the controller's module
beforeEach module 'chickenRandApp'
beforeEach module 'webAppApp'

MainCtrl = {}
scope = {}
Expand Down
19 changes: 19 additions & 0 deletions test/spec/controllers/rngviewer.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
'use strict'

describe 'Controller: RngviewerCtrl', () ->

# load the controller's module
beforeEach module 'webAppApp'

RngviewerCtrl = {}
scope = {}

# Initialize the controller and a mock scope
beforeEach inject ($controller, $rootScope) ->
scope = $rootScope.$new()
RngviewerCtrl = $controller 'RngviewerCtrl', {
$scope: scope
}

it 'should attach a list of awesomeThings to the scope', () ->
expect(scope.awesomeThings.length).toBe 3

0 comments on commit 68cbc3e

Please sign in to comment.