diff --git a/accountant-ui/js/app.js b/accountant-ui/js/app.js index 4dd1b87..2c5764d 100644 --- a/accountant-ui/js/app.js +++ b/accountant-ui/js/app.js @@ -91,7 +91,7 @@ angular.module('accountant', [ editableOptions.theme = 'bs3'; // bootstrap3 theme. Can be also 'bs2', 'default' }) -.service('LoginService', function($http) { +.factory('LoginService', function($http) { var login = function(email, password) { return $http.post('/api/user/login', { email: email, @@ -129,8 +129,8 @@ angular.module('accountant', [ callback: function() { vm.dialogShown = false; - var email = $('#email').val(); - var password = $('#password').val(); + var email = angular.element('#email').val(); + var password = angular.element('#password').val(); LoginService.login(email, password).success(function(result) { // TODO Alexis Lahouze 2015-08-28 Handle callback. // Call to /api/login to retrieve the token