npm.io
1.2.0 • Published 4 years ago

ngx-boolean-input

Licence
MIT
Version
1.2.0
Deps
1
Size
10 kB
Vulns
0
Weekly
0

ngx-boolean-input

Install

npm install ngx-boolean-input

How to use

import { BooleanInput } from 'ngx-boolean-input';

@Component({
  selector: 'app-component',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.scss']
})

export class AppComponent {

  @Input()
  @BooleanInput()
  editable: boolean | string | undefined;
}
<app-component></app-component> <!-- false -->
<app-component editable></app-component> <!-- true -->
<app-component [editable]="false"></app-component> <!-- false -->
<app-component editable="false"></app-component> <!-- false -->
<app-component [editable]="true"></app-component> <!-- true -->

Inspiration

Note

This library was generated with Nx.

Keywords