javascript - Masking Password -
i have application part of call, returns json string apart other details include password. now, in particular screen, when you're in view mode, show password masked (*******) in span, while if click on edit button, show password in input field.
it first time using angularjs this, , tried if there's filter can me in this, didn't go far. there other service able use mask password , show in span?
hi can achieve doing :
//html <span ng-show="showpassword" type="password">{{password | passwordfilter}}</span> <input ng-hide="showpassword" type="password" ng-model="password"> <input type="checkbox" ng-model="showpassword" ng-checked="false"> //js file app.filter('passwordfilter', function() { return function(input) { var split = input.split(''); var result = ""; for(var = 0 ; < split.length ; i++){ result += "*"; } return result; }; });
Comments
Post a Comment