Skip to content

Commit 0dacaaf

Browse files
author
welcome-dev
committed
feat(core): change console in angular to (#1551)
logs with $log in client idea proposed by @simison also removed unnecessary consoles in users.password.server.controller.js Fixes #1541
1 parent 1054be2 commit 0dacaaf

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

modules/articles/client/services/articles.client.service.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
.module('articles.services')
66
.factory('ArticlesService', ArticlesService);
77

8-
ArticlesService.$inject = ['$resource'];
8+
ArticlesService.$inject = ['$resource', '$log'];
99

10-
function ArticlesService($resource) {
10+
function ArticlesService($resource, $log) {
1111
var Article = $resource('api/articles/:articleId', {
1212
articleId: '@_id'
1313
}, {
@@ -47,7 +47,7 @@
4747

4848
function handleError(error) {
4949
// Log error
50-
console.log(error);
50+
$log.error(error);
5151
}
5252
}
5353
}());

modules/core/client/app/init.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,19 @@
1010
.module(app.applicationModuleName)
1111
.config(bootstrapConfig);
1212

13-
function bootstrapConfig($compileProvider, $locationProvider, $httpProvider) {
13+
bootstrapConfig.$inject = ['$compileProvider', '$locationProvider', '$httpProvider', '$logProvider'];
14+
15+
function bootstrapConfig($compileProvider, $locationProvider, $httpProvider, $logProvider) {
1416
$locationProvider.html5Mode(true).hashPrefix('!');
1517

1618
$httpProvider.interceptors.push('authInterceptor');
1719

1820
// Disable debug data for production environment
1921
// @link https://docs.angularjs.org/guide/production
2022
$compileProvider.debugInfoEnabled(app.applicationEnvironment !== 'production');
23+
$logProvider.debugEnabled(app.applicationEnvironment !== 'production');
2124
}
2225

23-
bootstrapConfig.$inject = ['$compileProvider', '$locationProvider', '$httpProvider'];
2426

2527
// Then define the init function for starting up the application
2628
angular.element(document).ready(init);

modules/users/server/controllers/users/users.password.server.controller.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,11 @@ exports.forgot = function (req, res, next) {
6262
httpTransport = 'https://';
6363
}
6464
var baseUrl = req.app.get('domain') || httpTransport + req.headers.host;
65-
console.log(baseUrl);
6665
res.render(path.resolve('modules/users/server/templates/reset-password-email'), {
6766
name: user.displayName,
6867
appName: config.app.title,
6968
url: baseUrl + '/api/auth/reset/' + token
7069
}, function (err, emailHTML) {
71-
console.log(emailHTML);
7270
done(err, emailHTML, user);
7371
});
7472
},

0 commit comments

Comments
 (0)