Skip to content

Instantly share code, notes, and snippets.

@guillefd
Created January 31, 2018 22:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save guillefd/9c7a73eb1c4ae1090260073838b72ff8 to your computer and use it in GitHub Desktop.
Save guillefd/9c7a73eb1c4ae1090260073838b72ff8 to your computer and use it in GitHub Desktop.
Angular, form checkbox, get check status when clicked
import { Component } from '@angular/core';
@Component({
selector: 'form',
templateUrl: `
<form>
<input type="checkbox" (click)="selected($event)"
</form>`,
styleUrls: ['./form.scss']
})
export class Form {
constructor() {}
selected(event:any) {
console.log('is checked:', event.currentTarget.checked);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment