Readdy Write  
0,00 €
Your View Money
Views: Count
Self 20% 0
Your Content 60% 0

Users by Links 0
u1*(Content+Views) 10% 0
Follow-Follower 0
s2*(Income) 5% 0

Count
Followers 0
Login Register as User

Angular Error NG8002: Can't bind to ngModel since it isn't a known property of input

22.12.2020 (πŸ‘238)

Angular Error NG8002: Can't bind to 'ngModel' since it isn't a known property of 'input'.

 

 

Fehlermeldung

bei Data Binding in Angular, wenn man versucht ein Eingabefeld mit ngModul an Daten zu Binden

 

 

Fehlermeldung in ng serve Fenster:

 

Error: src/app/components/liste/liste.component.html:1:54 - error NG8002: Can't bind to 'ngModel' since it isn't a known property of 'input'.

 

    1 <p>Eingabe: <input type="text" class="forms-control" [(ngModel)]="ListName" ></p>

                                                           ~~~~~~~~~~~~~~~~~~~~~~

 

      src/app/components/liste/liste.component.ts:6:16

        6   templateUrl: './liste.component.html',

                         ~~~~~~~~~~~~~~~~~~~~~~~~

        Error occurs in the template of component ListeComponent.

 

 

 

LΓΆsung

Man muss FormsModule in src\app\app.module.ts  einbinden

 

 

Angular .ts Code

import { BrowserModule } from '@angular/platform-browser';

import { NgModule } from '@angular/core';

import { FormsModule } from '@angular/forms'

import { AppComponent } from './app.component';

import { ListElementComponent } from './components/listElement/listElement.component';

import { ListeComponent } from './components/liste/liste.component';

@NgModule({

  declarations: [

    AppComponent,

    ListElementComponent,

    ListeComponent

  ],

  imports: [

    BrowserModule,

    FormsModule

  ],

  providers: [],

  bootstrap: [AppComponent]

})

export class AppModule { }