Angular 2: Can’t bind to ‘ngModel’ since it isn’t a known property of ‘input’

Figured out quick solution, update your @NgModule code like this : import { NgModule } from ‘@angular/core’; import { BrowserModule } from ‘@angular/platform-browser’; import { FormsModule } from ‘@angular/forms’; import { AppComponent } from ‘./app.component’; @NgModule({ imports: [ BrowserModule, FormsModule ], declarations: [ AppComponent ], bootstrap: [ AppComponent ] }) export class AppModule { } … Read more

What are the practical differences between template-driven and reactive forms?

Template Driven Forms Features:” Easy to use Suitable for simple scenarios and fails for complex scenarios Similar to AngularJS Two way data binding(using [(NgModel)] syntax) Minimal component code Automatic track of the form and its data(handled by Angular) Unit testing is another challenge Reactive Forms Features: More flexible, but needs a lot of practice Handles … Read more

tslint / codelyzer / ng lint error: “for (… in …) statements must be filtered with an if statement”

To explain the actual problem that tslint is pointing out, a quote from the JavaScript documentation of the for…in statement: The loop will iterate over all enumerable properties of the object itself and those the object inherits from its constructor’s prototype (properties closer to the object in the prototype chain override prototypes’ properties). So, basically … Read more

Can’t bind to ‘formGroup’ since it isn’t a known property of ‘form’

RC6/RC7/Final release FIX To fix this error, you just need to import ReactiveFormsModule from @angular/forms in your module. Here’s the example of a basic module with ReactiveFormsModule import: import { NgModule } from ‘@angular/core’; import { BrowserModule } from ‘@angular/platform-browser’; import { FormsModule, ReactiveFormsModule } from ‘@angular/forms’; import { AppComponent } from ‘./app.component’; @NgModule({ imports: … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)