
Research
Security News
The Growing Risk of Malicious Browser Extensions
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
ngx-show-hide-password
Advanced tools
> Add split input button to password or text input. Toggles input type between "text" and "password".
Add split input button to password or text input. Toggles input type between "text" and "password".
For an upt-to-date angular project version 16 with standalone Componentents:
npm install ngx-show-hide-password --save
npm install @fortawesome/angular-fontawesome \
@fortawesome/fontawesome-svg-core \
@fortawesome/free-solid-svg-icons --save
For angular project version 15 and Bootstrap 5:
npm install ngx-show-hide-password@2.6.5 --save
npm install @fortawesome/angular-fontawesome \
@fortawesome/fontawesome-svg-core \
@fortawesome/free-solid-svg-icons --save
:exclamation: For previous Angular releases please check the compatibility table of ngx-show-hide-password and @fortawesome/angular-fontawesome!
:white_check_mark: e.g. for angular version 8:
npm install ngx-show-hide-password@~2.1.0 --save
npm install @fortawesome/angular-fontawesome@^0.5 \
@fortawesome/fontawesome-svg-core \
@fortawesome/free-solid-svg-icons --save
// nothing to do in main.ts
...
// component.ts
import {
ShowHidePasswordComponent,
ShowHideInputDirective,
ShowHideStatusDirective,
ShowHideTriggerDirective,
} from 'ngx-show-hide-password';
@Component({
...
standalone: true,
imports: [
ShowHidePasswordComponent,
ShowHideInputDirective,
ShowHideStatusDirective,
ShowHideTriggerDirective,
],
})
export class AppComponent {
constructor(private showHideService: ShowHideService) {
...
effect(() => {
const show = this.showHideService.getSignal('password')();
...
});
}
}
// app.module.ts
import { ShowHidePasswordModule } from 'ngx-show-hide-password';
// no need to import @fortawesome/angular-fontawesome for the component
...
@NgModule({
...
imports: [
BrowserModule,
ShowHidePasswordModule,
...
],
...
})
<show-hide-password size="lg" btnStyle="primary" [btnOutline]="false">
<input type="password" name="..." >
</show-hide-password>
<mat-form-field>
<input id="mysecretpassword" type="password" placeholder="Password" matInput showHideInput>
<i matSuffix
class="material-icons"
showHideTrigger="mysecretpassword"
[showHideStatus]="{ materialIcon: true, id: 'mysecretpassword' }"
></i>
</mat-form-field>
Password hidden | Password exposed |
---|---|
![]() | ![]() |
Demo on stackblitz
attribute | type | description |
---|---|---|
btnOutline | boolean | default: true |
btnStyle | string | 'primary' , 'secondary' , 'success' , 'warning' , 'danger' or 'info' . default: 'secondary' |
size | string | 'sm' , 'lg' . default: nothing. |
Demo on stackblitz
:information_source: All directives (and the service) are bound to the same unique id. This can be the attribute id of the HTML input element or you can enter a synthetic ID.
attribute | type | description |
---|---|---|
id | string | unique id. |
type | description |
---|---|
string | unique id. * required |
export interface ShowHideStatusConfig {
id: string;
show?: string;
hide?: string;
materialIcon?: boolean;
}
attribute | type | description |
---|---|---|
id | string | unique id. * required |
show | string | optional class/material icon identifier. default: 'visibility' |
hide | string | optional class/material icon identifier. default: 'visibility_off' |
materialIcon | boolean | if true updates innerHTML instead of class attribute. default: false |
return Signal for input with id
getSignal(id: string): WritableSignal<boolean>
set Status for input with id
setShow(id: string, show: boolean): void
toggles Status for input with id
toggleShow(id: string): void
Input()
. Thanks to @aboodzbtnStyle
and btnOutline
@1.1.0
insteadlocal version | angular version | Bootstrap version | standalone |
---|---|---|---|
@^19.0.0 | v19 | v5 | ✅ |
@^2.8.0 | v19 | v5 | ✅ |
@^2.7.4 | v18 | v5 | ✅ |
@^2.7.2 | v17 | v5 | ✅ |
@^2.7.0 | v16 | v5 | ✅ |
@^2.6.5 | v15 | v5 | |
@^2.6.4 | v14 | v5 | |
@^2.6.1 | v13 | v5 | |
@^2.4.0 | v13 | v4 | |
@^2.3.1 | v11 | ||
@^2.3.0 | v10 | ||
@^2.2.3 | v9 | ||
@~2.1.0 | v8 | ||
@~2.0.3 | v7 | ||
@~1.2.5 | v5 and v6 | ||
@~1.1.0 | v4 |
:exclamation: The Bootstrap version is only important if you use the show-hide-password
Component.
git branch -m master main
git fetch origin
git branch -u origin/main main
MIT © Oliver Sahner
FAQs
> Add split input button to password or text input. Toggles input type between "text" and "password".
The npm package ngx-show-hide-password receives a total of 1,016 weekly downloads. As such, ngx-show-hide-password popularity was classified as popular.
We found that ngx-show-hide-password demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Research
Security News
An in-depth analysis of credential stealers, crypto drainers, cryptojackers, and clipboard hijackers abusing open source package registries to compromise Web3 development environments.
Security News
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.