Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

Commit

Permalink
Simplified Gruntfile, Minor Bug Fixing
Browse files Browse the repository at this point in the history
  • Loading branch information
amoshaviv committed May 20, 2014
1 parent c290dc9 commit 62bf313
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 37 deletions.
1 change: 1 addition & 0 deletions app/views/layout.server.view.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
{% if process.env.NODE_ENV === 'development' %}
<!--Livereload script rendered -->
<script type="text/javascript" src="http://localhost:35729/livereload.js"></script>

{% endif %}
</body>

Expand Down
38 changes: 25 additions & 13 deletions gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,47 +1,57 @@
'use strict';

module.exports = function(grunt) {
// Unified Watch Object
var watchFiles = {
serverViews: ['app/views/**/*.*'],
serverJS: ['gruntfile.js', 'server.js', 'config/**/*.js', 'app/**/*.js'],
clientViews: ['public/modules/**/views/*.html'],
clientJS: ['public/js/*.js', 'public/modules/**/*.js'],
clientCSS: ['public/modules/**/*.css'],
mochaTests: ['app/tests/**/*.js']
};

// Project Configuration
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
watch: {
serverViews: {
files: ['app/views/**'],
files: watchFiles.serverViews,
options: {
livereload: true,
livereload: true
}
},
serverJS: {
files: ['gruntfile.js', 'server.js', 'config/**/*.js', 'app/**/*.js'],
files: watchFiles.serverJS,
tasks: ['jshint'],
options: {
livereload: true,
livereload: true
}
},
clientViews: {
files: ['public/modules/**/views/*.html'],
files: watchFiles.clientViews,
options: {
livereload: true,
}
},
clientJS: {
files: ['public/js/*.js', 'public/modules/**/*.js'],
files: watchFiles.clientJS,
tasks: ['jshint'],
options: {
livereload: true,
livereload: true
}
},
clientCSS: {
files: ['public/**/css/*.css'],
files: watchFiles.clientCSS,
tasks: ['csslint'],
options: {
livereload: true,
livereload: true
}
}
},
jshint: {
all: {
src: ['gruntfile.js', 'server.js', 'config/**/*.js', 'app/**/*.js', 'public/js/**/*.js', 'public/modules/**/*.js'],
src: watchFiles.clientJS.concat(watchFiles.serverJS),
options: {
jshintrc: true
}
Expand All @@ -52,7 +62,7 @@ module.exports = function(grunt) {
csslintrc: '.csslintrc',
},
all: {
src: ['public/modules/**/css/*.css']
src: watchFiles.clientCSS
}
},
uglify: {
Expand All @@ -76,7 +86,9 @@ module.exports = function(grunt) {
dev: {
script: 'server.js',
options: {
nodeArgs: ['--debug']
nodeArgs: ['--debug'],
ext: 'js, html',
watch: watchFiles.serverViews.concat(watchFiles.serverJS)
}
}
},
Expand Down Expand Up @@ -113,7 +125,7 @@ module.exports = function(grunt) {
}
},
mochaTest: {
src: ['app/tests/**/*.js'],
src: watchFiles.mochaTests,
options: {
reporter: 'spec',
require: 'server.js'
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"grunt-nodemon": "~0.2.1",
"grunt-concurrent": "~0.5.0",
"grunt-mocha-test": "~0.10.0",
"grunt-ngmin": "0.0.3",
"grunt-ngmin": "0.0.3",
"grunt-karma": "~0.8.2",
"load-grunt-tasks": "~0.4.0",
"karma": "~0.12.0",
Expand All @@ -66,4 +66,4 @@
"karma-firefox-launcher": "~0.1.3",
"karma-phantomjs-launcher": "~0.1.2"
}
}
}
42 changes: 21 additions & 21 deletions public/modules/articles/config/articles.client.routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@

// Setting up route
angular.module('articles').config(['$stateProvider',
function($stateProvider) {
// Articles state routing
$stateProvider.
state('listArticles', {
url: '/articles',
templateUrl: 'modules/articles/views/list-articles.client.view.html'
}).
state('createArticle', {
url: '/articles/create',
templateUrl: 'modules/articles/views/create-article.client.view.html'
}).
state('viewArticle', {
url: '/articles/:articleId',
templateUrl: 'modules/articles/views/view-article.client.view.html'
}).
state('editArticle', {
url: '/articles/:articleId/edit',
templateUrl: 'modules/articles/views/edit-article.client.view.html'
});
}
]);
function($stateProvider) {
// Articles state routing
$stateProvider.
state('listArticles', {
url: '/articles',
templateUrl: 'modules/articles/views/list-articles.client.view.html'
}).
state('createArticle', {
url: '/articles/create',
templateUrl: 'modules/articles/views/create-article.client.view.html'
}).
state('viewArticle', {
url: '/articles/:articleId',
templateUrl: 'modules/articles/views/view-article.client.view.html'
}).
state('editArticle', {
url: '/articles/:articleId/edit',
templateUrl: 'modules/articles/views/edit-article.client.view.html'
});
}
]);
5 changes: 5 additions & 0 deletions public/modules/core/controllers/header.client.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,10 @@ angular.module('core').controller('HeaderController', ['$scope', 'Authentication
$scope.toggleCollapsibleMenu = function() {
$scope.isCollapsed = !$scope.isCollapsed;
};

// Collapsing the menu after navigation
$scope.$on('$stateChangeSuccess', function() {
$scope.isCollapsed = false;
});
}
]);
2 changes: 1 addition & 1 deletion public/modules/core/views/home.client.view.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<div class="col-md-12 column">
<div class="jumbotron text-center">
<h1>
<img alt="140x140" src="http://meanjs.org/img/logo.png" />
<img alt="MEAN.JS" class="img-responsive" src="http://meanjs.org/img/logo.png" />
</h1>
<p>
Open-Source Full-Stack Solution For MEAN Applications
Expand Down

0 comments on commit 62bf313

Please sign in to comment.