From 6cfa74ef7636c2c1b48c1a4f3690f6e552e9519b Mon Sep 17 00:00:00 2001 From: Sylvain LAPENDRY Date: Tue, 27 Jan 2015 20:01:16 +0100 Subject: [PATCH] Auth service Added the $window, no need of _this. --- .../services/authentication.client.service.js | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/public/modules/users/services/authentication.client.service.js b/public/modules/users/services/authentication.client.service.js index 4418b2d7..56225dba 100644 --- a/public/modules/users/services/authentication.client.service.js +++ b/public/modules/users/services/authentication.client.service.js @@ -1,14 +1,10 @@ 'use strict'; // Authentication service for user variables -angular.module('users').factory('Authentication', [ - function() { - var _this = this; - - _this._data = { - user: window.user - }; - - return _this._data; - } -]); \ No newline at end of file +angular.module('users').factory('Authentication', ['$window', function($window) { + var auth = { + user: $window.user + }; + + return auth; +}]);