Skip to content

SteffenKoehler/ngx-boolean-input

Repository files navigation

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 project was generated using Nx.