I would go through this guide on ngModules
first: https://angular.io/docs/ts/latest/guide/ngmodule.html. It has a
really good walkthrough on how to use ngModels, including answering those
exact questions that you're asking. I believe in that guide they eventually
remove FormsModule from app.module.ts and import in another module that
needs it.
On Monday, August 22, 2016 at 7:28:26 PM UTC-4, Dawg wrote:
>
> Hello,
>
> I'm working through, couple of tutorials to get a better understanding how
> angular 2 works and I'm getting mixed signals between varies perspectives.
>
> *I need a better description or how/when to use app.module.ts.*
>
> I'm going through the hero tutorial found on angular.io more specifically
> the section talking about two way binding; i'm bit confused as to why you
> would import:
> *import { FormsModule} from '@angular/forms';* into app.module.ts and
> add the class as described below:
>
> @NgModule({
> * imports: * [ BrowserModule,
> * FormsModule*],
> declarations: [ AppComponent ],
> bootstrap: [ AppComponent ]
> })
>
> 1. Can this not be done in the component where the input field is
> templated?
> 2. what reason is there to import this into app.module.ts?
> 3. is putting the above in app.module.ts makes the class act like a global
> variable?
> 2. different tutorial isn't even using *import { FormsModule} from
> '@angular/forms' explain two way binding.*
>
> *I'm missing something there and any help you can provide would be greatly
> appreciated.*
> *thanks*
>
>
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.