Angular 2: Difference between revisions

Jump to navigation Jump to search
322 bytes added ,  13 April 2016
Line 1: Line 1:
== Forms ==
== Forms ==
=== FormBuilder ===
<syntaxhighlight lang="typescript">
export class DemoFormSkuBuilder {
  myForm: ControlGroup;
  constructor(fb: FormBuilder) {
    this.myForm = fb.group({
      'sku': ['ABC123']
    });
  }
  onSubmit(value:string): void {
    console.log('you submitted value: ',value);
  }
}
</syntaxhighlight>


=== @Component Annotation ===
=== @Component Annotation ===

Navigation menu