Tangle Designer
Tangle Designer

Reputation: 25

Confirm password in Angular JS

https://embed.plnkr.co/oCd2WrzJjFtvgsGdHrdV3b/

Hello , I created Login page and Register page. But I need to add an additional functionality of confirm password. I am pretty confused in handling this with my controllers.

can anyone help me in validation part.

When I give Ng-match or directives , it is not compatible with my existing controller. Either it states Registration successful in case of wrong password or else my view is just empty in browser.

Upvotes: 1

Views: 480

Answers (2)

Ashok Reddy
Ashok Reddy

Reputation: 174

plnkr.co/edit/LRXKpql1AxmGNcTWifGS?p=preview

I solved the issue you faced with confirmPassword. I'm just saying where you made the mistake 1)password name in ng-modal and name in "required data-password-verify" at confirm password should match when you compare two passwords. 2)Please have a look at console first,then you understand where you did a mistake.Console clearly saying two issues i.e app is not defined at passwordVerify.js and User service not defined. 3)I changed passwordVerfiy directive to register controller and I commented userservice wherever i find.Because I have not seen anywhere you are using Userservice class.Both the files(user.service and user.service,localstorage) are empty

I would be more happy if my code resolve your problem. Thank you

Upvotes: 1

Paresh Gami
Paresh Gami

Reputation: 4782

Use following ng-match directive

http://ngmodules.org/modules/ng-match

Upvotes: 2

Related Questions