-1

below is the code snippet, i am getting above error even after importing Formmodule, its not resolving

app.module.ts

import { BrowserModule } from '@angular/platform-browser';
import {NgModule} from '@angular/core';
import {FormsModule} from '@angular/forms';
import {AppComponent} from './app.component';
import{firstComponent} from './first/first.component';

import { SecondComponent } from './second/second.component';


@NgModule({
  declarations: [
    AppComponent,
    firstComponent,
    SecondComponent
  ],
  imports: [
      BrowserModule,
      FormsModule
  ],

Sec.component.html
==================

<input type="text" [(ngmodel)]="TwoWayData" [value]="TwoWayData" name=""  >
{{TwoWayData}}

Sec.component.ts

TwoWayData:string='Fortune';
Vijay Dodamani
  • 264
  • 1
  • 9
  • 1
    Possible duplicate of [Angular error: "Can't bind to 'ngModel' since it isn't a known property of 'input'"](https://stackoverflow.com/questions/43298011/angular-error-cant-bind-to-ngmodel-since-it-isnt-a-known-property-of-inpu) – spots Jul 15 '19 at 18:37
  • It's `ngModel`, not `ngmodel`. Voting to close for typo. – JB Nizet Jul 15 '19 at 18:39

1 Answers1

2

Your problem is here, in [(ngmodel)] M is capital

[(ngmodel)]="TwoWayData"

Replace It

<input type="text" [(ngModel)]="TwoWayData" [value]="TwoWayData" name="">

{{TwoWayData}}

Bhavesh Ajani
  • 991
  • 9
  • 11