Created
August 25, 2016 14:18
-
-
Save orlaqp/893c13f26c2c53644f6daefadbfcd4bc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Component | |
import { Component, OnInit } from '@angular/core'; | |
import { REACTIVE_FORM_DIRECTIVES, FormGroup } from '@angular/forms'; | |
import { MATERIAL_FORM } from '../../../../../dist/ng2-materialform'; | |
@Component({ | |
selector: 'demo-checkbox', | |
directives: [MATERIAL_FORM, REACTIVE_FORM_DIRECTIVES, FormGroup], | |
template: require('./checkbox.html'), | |
}) | |
export class DemoCheckboxComponent implements OnInit { | |
public fg: FormGroup; | |
constructor() { | |
this.fg = new FormGroup({}); | |
} | |
ngOnInit() { } | |
} | |
// View | |
<form [formGroup]="fg" #f="ngForm"> | |
<checkbox [fgd]="f" field="toggle1" label="Simple Checkbox"></checkbox> | |
</form> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment