How to get ngForm variable reference in the component class?
import this -
import {ViewChild} from 'angular2/core';
Just add this field with the annotation to the class
// Dart syntax@ViewChild('heroForm') NgForm heroForm;
You can't use it in the constructor though because it is only set later. In ngAfterViewInit
or event handlers for user input you can use it without limitations.