TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Dev Teywa
NA
250
40.8k
how to validate form in angular2
Jan 28 2018 11:30 AM
Hello,
I have a form that contains an email, password and password confirmation
I have to check if user has entered a valid email and password must be minimum of 8 characters (upper case, miniscule, number) and password confirmation = password
how to do it please without using the classes I want a simple method
And thank you in advance
<
div
class
=
"container"
>
<
div
class
=
"panel-body"
>
<
div
class
=
"row"
>
<
label
for
=
"email"
>
Email
</
label
>
<
div
class
=
"form-group"
>
<
input
[(ngModel)]="user.email"
id
=
"email"
class
=
"form-control"
type
=
"email"
/>
</
div
>
</
div
>
<
div
class
=
"row"
>
<
label
for
=
"password"
>
Password
</
label
>
<
div
class
=
"form-group"
>
<
input
[(ngModel)]="user.password"
id
=
"password"
class
=
"form-control"
type
=
"password"
/>
</
div
>
</
div
>
<
div
class
=
"row"
>
<
label
for
=
"passwordconf"
>
Password Confirmation
</
label
>
<
div
class
=
"form-group"
>
<
input
id
=
"passwordconf"
class
=
"form-control"
type
=
"password"
/>
</
div
>
</
div
>
<
span
>
{{errorMsg}}
</
span
>
<
button
(click)="login()"
class
=
"btn btn-primary"
type
=
"submit"
name
=
"action"
>
Login
</
button
>
<
a
[routerLink]='["/register"]'
>
Register
</
a
>
</
div
>
</
div
>
Reply
Answers (
2
)
how to check whether it is user login or not using angular2
What is the difference between services/classes in angular2