4,500
edits
Line 46: | Line 46: | ||
=== @Component Annotation === | === @Component Annotation === | ||
< | <source lang="typescript"> | ||
import {Component} from 'angular2/core'; | import {Component} from 'angular2/core'; | ||
import {FORM_DIRECTIVES} from 'angular2/common'; | import {FORM_DIRECTIVES} from 'angular2/common'; | ||
Line 75: | Line 75: | ||
bootstrap(MyApp); | bootstrap(MyApp); | ||
}) | }) | ||
</ | </source> | ||
ngForm includes the <code>form</code> tag in its selector (instead of requiring you to explicitly add ngForm as an attribute). If you inject FORM_DIRECTIVES, ngForm will get automatically attached to any <form> tags you have in your view. | ngForm includes the <code>form</code> tag in its selector (instead of requiring you to explicitly add ngForm as an attribute). If you inject FORM_DIRECTIVES, ngForm will get automatically attached to any <form> tags you have in your view. |