BEST
DEALS
OF THE
YEAR!
SAVE UP TO $3,000
24 NOV
1 DEC
00 Days
00 Hrs
00 Min
00 Sec
Filter by title

Show Password Directive

In password input, text can be shown easily via changing input type attribute to text. To make this even easier, you can use the ShowPasswordDirective which has been exposed by the @abp/ng.core package.

Getting Started

ShowPasswordDirective is standalone. In order to use the it in an HTML template, import it to your component:

Importing to Component

import { ShowPasswordDirective } from '@abp/ng.core';

@Component({
  //...
  imports: [
   // ...,
   ShowPasswordDirective
  ],
})
export class TestComponent {}

Usage

The ShowPasswordDirective is very easy to use. The directive's selector is abpShowPassword. By adding the abpShowPassword attribute to an input element, you can activate the ShowPasswordDirective for the input element.

See an example usage:

import { ShowPasswordDirective } from '@abp/ng.core';
@Component({
  selector: 'sample-component',
  template: `
    <div class="d-flex flex-column">
      <label>Password</label>
      <input [abpShowPassword]="showPassword"/>
      <i (click)="showPassword = !showPassword">icon</i>
    </div>
  `,
  imports: [ShowPasswordDirective]
})
export class SampleComponent{
  showPassword = false;
}

The abpShowPassword attribute has been added to the <input> element. Click icon to activate the ShowPasswordDirective.

See the result:

Show Password directive

To see password input click icon.

Show Password directive

Was this page helpful?

Please make a selection.

To help us improve, please share your reason for the negative feedback in the field below.

Please enter a note.

Thank you for your valuable feedback!

Please note that although we cannot respond to feedback, our team will use your comments to improve the experience.

ABP Community Talks
What’s new with .NET 10 & ABP 10?
20 Nov, 17:00
Online
Watch the Event
ABP Live Webinar
Webinar Calendar Webinar Calendar
Discover
ABP Platform
Register Now
Nov 26
Wednesday,
17:00 UTC
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.