Browse Source

Update Show-Password-Directive.md

pull/17231/head
Sinan Öztürk 3 years ago
committed by GitHub
parent
commit
3daec5dd22
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 26
      docs/en/UI/Angular/Show-Password-Directive.md

26
docs/en/UI/Angular/Show-Password-Directive.md

@ -6,11 +6,16 @@ In password input, text can be shown easily via changing input type attribute to
## Getting Started
`ShowPasswordDirective` is standalone. In order to use the `ShowPasswordDirective` in an HTML template, import it to related module or your standalone component:
**Importing to NgModule**
```ts
import { ShowPasswordDirective } from '@abp/ng.core';
@NgModule({
//...
declarations: [
...,
TestComponent
],
imports: [
...,
ShowPasswordDirective
@ -25,10 +30,27 @@ The `ShowPasswordDirective` is very easy to use. The directive's selector is **`
See an example usage:
**NgModule Component usage**
```ts
import { ShowPasswordDirective } from '@abp/ng.core';
@Component({
selector: 'test-component',
template: `
<div class="d-flex flex-column">
<label>Password</label>
<input [abpShowPassword]="showPassword"/>
<i (click)="showPassword = !showPassword">icon</i>
</div>
`
})
export class TestComponent{
showPassword = false;
}
```
**Standalone Component usage**
```ts
import { ShowPasswordDirective } from '@abp/ng.core';
@Component({
selector: 'standalone-component',
standalone: true,
template: `
<div class="d-flex flex-column">
@ -39,7 +61,7 @@ import { ShowPasswordDirective } from '@abp/ng.core';
`,
imports: [ShowPasswordDirective]
})
export class TestComponent{
export class StandaloneComponent{
showPassword = false;
}
```

Loading…
Cancel
Save