Demo entry 6356492

nieco

   

Submitted by anonymous on Apr 18, 2017 at 18:44
Language: TypeScript. Code size: 374 Bytes.

@Component({})
export class HeroFormComponent implements OnInit {
  heroForm: FormGroup; 
  name: AbstractControl; 

  constructor(private _formBuilder: FormBuilder,) {
      this.heroForm = _formBuilder.group({
        name: ['John', Validators.required]
     });
      this.name = this.heroForm.controls['name'];
 }
  onSubmit(values) { console.log(values)}
}

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).