Can anyone help me figure out why this error keeps occurring?
ERROR in ./login/loginController.js
Module parse failed: /Users/leon/Projects/admin/login/loginController.js Line 66: Unexpected token }
You may need an appropriate loader to handle this file type.
| console.log('login failed!');
| }
| }
| }
|
@ ./entry.js 16:22-59
This section pertains to my entry.js file
Below is the loginController code snippet (line 66 contains the last closing }
):
var loginController = angular
.module('loginController', [])
.controller('LoginCtrl', LoginCtrl);
LoginCtrl.$inject = [
'$rootScope',
'$scope',
'$location',
'$timeout',
'ApiFactory',
'AUTH_EVENTS',
'AuthFactory'];
function LoginCtrl(
$rootScope,
$scope,
$location,
$timeout,
ApiFactory,
AUTH_EVENTS,
AuthFactory) {
/** Initialize LoginCtrl scope */
var vs = $scope;
vs.login = login;
$rootScope.$broadcast(AUTH_EVENTS.loginSuccess);
$rootScope.$on(AUTH_EVENTS.notAuthenticated, function (event, data) {
$rootScope.currentUser = null;
$scope.currentUser = null;
AuthFactory.logout();
$location.path('/login');
});
function login(credentials) {
console.log('credentials',credentials);
AuthFactory.login(credentials).then(function (user) {
$rootScope.$broadcast(AUTH_EVENTS.loginSuccess);
$scope.setCurrentUser(user);
if (user.password_reset) {
$location.path('/password');
} else {
$location.path('/tickers');
}
}, function () {
// $scope.loginData.message = "Invalid Username/Password";
$rootScope.$broadcast(AUTH_EVENTS.loginFailed);
console.log('login failed!');
}
}
}
module.exports = loginController;