Angular 2: Difference between revisions

Jump to navigation Jump to search
18 bytes removed ,  11 May 2016
Line 46: Line 46:
=== @Component Annotation ===
=== @Component Annotation ===


<syntaxhighlight lang="typescript">
<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);
})
})
</syntaxhighlight>
</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.

Navigation menu