123456789101112131415161718192021222324252627282930313233 |
- (function ()
- {
- 'use strict';
- app.controller('Login', ['$scope', 'account.repository', '$location','utils',function ($scope, accountRepository, $location, utils)
- {
- $scope.user =
- {
- login: 'admin@gmail.com',
- password: 'qQ1!1111'
- };
- $scope.login = function ()
- {
- accountRepository.login($scope.user)
- .then(function (response) {
- console.log(response)
- $location.path('/');
- localStorage.setItem('authToken', response.data.authToken);
- utils.notify({
- message: 'hello, dude ' + response.data.login,
- type: 'succes'
- })
- }, function (error)
- {
-
- }
- )
- };
- }
- ]);
- }
- )();
|