I am a new bee to angular 2. I have seen multiple answers on stackoverflow but none of them is working in my case here is the error that it is showing
Can't bind to 'ngModel' since it isn't a known property of 'md-select'. 1. If 'md-select' is an Angular component and it has 'ngModel' input, then verify that it is part of this module.
and here is my code app.module.ts
import { BrowserModule } from '@angular/platform-browser';
import { MaterialModule } from '@angular/material';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import 'hammerjs';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
MaterialModule.forRoot(),
NavigationModule,
FormsModule
],
bootstrap: [
AppComponent
]
})
**my component**
export class ToolbarComponent {
private item: string = '3';
}
in the template of the component
<md-select [(ngModel)]="item">
<md-option *ngFor="let v of allvalues()" [attr.selected]="v == avalue() ? true : null">{{v | translate}}</md-option>
</md-select>
please help me in solving this problem its been 2 days I am stuck at this problem.