Skip to content

Instantly share code, notes, and snippets.

@jcamilom
Created September 18, 2020 04:16
Show Gist options
  • Save jcamilom/0bc13bfed3bc79254a31b3227d94777a to your computer and use it in GitHub Desktop.
Save jcamilom/0bc13bfed3bc79254a31b3227d94777a to your computer and use it in GitHub Desktop.
@Component({
selector: 'simple-check-option',
template: `
<label>
<input type="checkbox" [formControl]="control">
{{ label }}
</label>
`
})
export class SimpleCheckOptionComponent {
@Input() value: any;
@Input() label: string;
public control = new FormControl(false);
get valueChanges$(): Observable<boolean> {
return this.control.valueChanges;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment