From long back we were planning to share our knowledge on the emerging technologies in the world. To quench your thirst we are launching our first post on Angular JS pragmatic scenarios.Hope your feedback and suggestions will motivate us to share more with the technology lovers.
Requirement:- How a user can check the password entered in the text-box and rectify it in-case entered wrongly.
Our approach is to change the Type of a text-box from “Text” to “Password” or vice versa , as per the convenience of the user.
Creating a directive which handles the change event of the user action(We have given “checkbox” option to user to trigger the change event).Check the option “Check Me” and the Password is visible to user.
|Check Me, to make Password visible|
We have leveraged “Angular Expressions”, to achieve the required functionality.
Here we set a flag , and its value is getting changed based on the change event (which is fired by a user on selection of checkbox).It’s default value is “False”, meaning that textbox default behaviour is “Password” type.
|HTML Code(Using Angular Expressions)|