Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
ulakbus-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ulakbus
ulakbus-ui
Commits
c1d7b733
Commit
c1d7b733
authored
May 21, 2015
by
Evren Kutar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use isvalidemail in custom validation
parent
af99d361
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
4 deletions
+19
-4
login.js
app/login/login.js
+19
-4
No files found.
app/login/login.js
View file @
c1d7b733
...
@@ -11,7 +11,7 @@ login.config(['$routeProvider', function ($routeProvider) {
...
@@ -11,7 +11,7 @@ login.config(['$routeProvider', function ($routeProvider) {
// controller: 'LoginCtrl'
// controller: 'LoginCtrl'
//});
//});
}]);
}]);
login
.
controller
(
'LoginCtrl'
,
function
(
$scope
,
$http
,
$location
,
$rootScope
,
AUTH_EVENTS
,
LoginService
)
{
login
.
controller
(
'LoginCtrl'
,
function
(
$scope
,
$
q
,
$timeout
,
$
http
,
$location
,
$rootScope
,
AUTH_EVENTS
,
LoginService
)
{
$scope
.
schema
=
$scope
.
schema
=
{
{
title
:
"Login"
,
title
:
"Login"
,
...
@@ -44,7 +44,23 @@ login.controller('LoginCtrl', function ($scope, $http, $location, $rootScope, AU
...
@@ -44,7 +44,23 @@ login.controller('LoginCtrl', function ($scope, $http, $location, $rootScope, AU
$scope
.
form
=
[
$scope
.
form
=
[
{
{
key
:
"email"
,
key
:
"email"
,
type
:
"email"
type
:
"email"
,
validationMessages
:
{
'emailNotValid'
:
'Email is not valid!'
},
$asyncValidators
:
{
emailNotValid
:
function
(
value
){
var
deferred
=
$q
.
defer
();
$timeout
(
function
(){
if
(
LoginService
.
isValidEmail
(
value
))
{
deferred
.
resolve
();
}
else
{
deferred
.
reject
();
}
},
500
);
return
deferred
.
promise
;
}
}
},
},
{
{
key
:
"password"
,
key
:
"password"
,
...
@@ -63,8 +79,7 @@ login.controller('LoginCtrl', function ($scope, $http, $location, $rootScope, AU
...
@@ -63,8 +79,7 @@ login.controller('LoginCtrl', function ($scope, $http, $location, $rootScope, AU
var
credentials
=
{
email
:
form
.
email
.
$modelValue
,
password
:
form
.
password
.
$modelValue
};
var
credentials
=
{
email
:
form
.
email
.
$modelValue
,
password
:
form
.
password
.
$modelValue
};
console
.
log
(
form
);
console
.
log
(
form
);
var
loginResponse
=
LoginService
.
login
(
credentials
);
LoginService
.
login
(
credentials
);
console
.
log
(
loginResponse
);
}
}
else
{
else
{
console
.
log
(
"not valid"
);
console
.
log
(
"not valid"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment