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

Commit

Permalink
Removes unnecessary whitespace, formats code and add comments
Browse files Browse the repository at this point in the history
Fixes #441
  • Loading branch information
miguelcoba committed Mar 2, 2015
1 parent 7797c16 commit 482ab19
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 10 deletions.
4 changes: 2 additions & 2 deletions app/controllers/articles.server.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ exports.articleByID = function(req, res, next, id) {
if (err) return next(err);
if (!article) {
return res.status(404).send({
message: 'Article not found'
});
message: 'Article not found'
});
}
req.article = article;
next();
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/users/users.password.server.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ var _ = require('lodash'),
nodemailer = require('nodemailer'),
async = require('async'),
crypto = require('crypto');

var smtpTransport = nodemailer.createTransport(config.mailer.options);

/**
Expand Down
2 changes: 1 addition & 1 deletion app/tests/article.server.model.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ describe('Article Model Unit Tests:', function() {

afterEach(function(done) {
Article.remove().exec(function() {
User.remove().exec(done);
User.remove().exec(done);
});
});
});
2 changes: 1 addition & 1 deletion app/tests/article.server.routes.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ describe('Article CRUD tests', function() {

afterEach(function(done) {
User.remove().exec(function() {
Article.remove().exec(done);
Article.remove().exec(done);
});
});
});
6 changes: 4 additions & 2 deletions app/views/layout.server.view.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@

<!--Application CSS Files-->
{% for cssFile in cssFiles %}
<link rel="stylesheet" href="{{cssFile}}">{% endfor %}
<link rel="stylesheet" href="{{cssFile}}">
{% endfor %}

<!-- HTML5 Shim -->
<!--[if lt IE 9]>
Expand All @@ -59,7 +60,8 @@

<!--Application JavaScript Files-->
{% for jsFile in jsFiles %}
<script type="text/javascript" src="{{jsFile}}"></script>{% endfor %}
<script type="text/javascript" src="{{jsFile}}"></script>
{% endfor %}

{% if process.env.NODE_ENV === 'development' %}
<!--Livereload script rendered -->
Expand Down
4 changes: 2 additions & 2 deletions config/env/all.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = {
// The name of the MongoDB collection to store sessions in
sessionCollection: 'sessions',
// The session cookie settings
sessionCookie: {
sessionCookie: {
path: '/',
httpOnly: true,
// If secure is set to true then it will cause the cookie to be set
Expand All @@ -25,7 +25,7 @@ module.exports = {
// Only set the maxAge to null if the cookie shouldn't be expired
// at all. The cookie will expunge when the browser is closed.
maxAge: null,
// To set the cookie in a specific domain uncomment the following
// To set the cookie in a specific domain uncomment the following
// setting:
// domain: 'yourdomain.com'
},
Expand Down
10 changes: 10 additions & 0 deletions public/modules/articles/controllers/articles.client.controller.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,31 @@
'use strict';

// Articles controller
angular.module('articles').controller('ArticlesController', ['$scope', '$stateParams', '$location', 'Authentication', 'Articles',
function($scope, $stateParams, $location, Authentication, Articles) {
$scope.authentication = Authentication;

// Create new Article
$scope.create = function() {
// Create new Article object
var article = new Articles({
title: this.title,
content: this.content
});

// Redirect after save
article.$save(function(response) {
$location.path('articles/' + response._id);

// Clear form fields
$scope.title = '';
$scope.content = '';
}, function(errorResponse) {
$scope.error = errorResponse.data.message;
});
};

// Remove existing Article
$scope.remove = function(article) {
if (article) {
article.$remove();
Expand All @@ -35,6 +42,7 @@ angular.module('articles').controller('ArticlesController', ['$scope', '$statePa
}
};

// Update existing Article
$scope.update = function() {
var article = $scope.article;

Expand All @@ -45,10 +53,12 @@ angular.module('articles').controller('ArticlesController', ['$scope', '$statePa
});
};

// Find a list of Articles
$scope.find = function() {
$scope.articles = Articles.query();
};

// Find existing Article
$scope.findOne = function() {
$scope.article = Articles.get({
articleId: $stateParams.articleId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

(function() {
// Articles Controller Spec
describe('ArticlesController', function() {
describe('Articles Controller Tests', function() {
// Initialize global variables
var ArticlesController,
scope,
Expand Down

0 comments on commit 482ab19

Please sign in to comment.