Currently, I am working with the AngularJS Material library and I am facing an issue with a prompt dialog that I need to display for users to enter a password. The problem is that even though the dialog functions correctly, the text field does not have the 'password' type, making the entered password visible to others.
Is there a way to change the text field type to 'password'? Or do I need to create a custom dialog from scratch to achieve this?
Below is a snippet from the AngularJS Material website:
$scope.showPrompt = function(ev) {
// Appending dialog to document.body to cover sidenav in docs app
var confirm = $mdDialog.prompt()
.title('What would you name your dog?')
.textContent('Bowser is a common name.')
.placeholder('Dog name')
.ariaLabel('Dog name')
.initialValue('Buddy')
.targetEvent(ev)
.required(true)
.ok('Okay!')
.cancel('I\'m a cat person');
$mdDialog.show(confirm).then(function(result) {
$scope.status = 'You decided to name your dog ' + result + '.';
}, function() {
$scope.status = 'You didn\'t name your dog.';
});
};
https://material.angularjs.org/latest/demo/dialog
Appreciate any help on this matter. Thank you.