YouAndWeb_TwoToc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
'use strict';
angular.module('dashboardApp')
.controller('LoginCtrl', function($scope, Auth, $state, $window) {
$scope.user = {};
$scope.errors = {};
$scope.login = function(form) {
$scope.submitted = true;
if (form.$valid) {
Auth.login({
email: $scope.user.email,
password: $scope.user.password
})
.then(function() {
// Logged in, redirect to home
$state.go('main');
})
.catch(function(err) {
$scope.errors.other = err.message;
});
}
};
$scope.loginOauth = function(provider) {
$window.location.href = '/auth/' + provider;
};
});
|
Revision |
Author |
Commited |
Message |
a2ecfb ...
|
PTKDev |
Fri 20 Nov, 2015 11:22:35 +0000 |
|