Can't bind to 'ngForOf' since it isn't a known property of 'tr' (final release)

Mourad Idrissi :

I'm using Angular2 Final release (2.1.0). When I want to display a list of companies, I got this error.

in file.component.ts :

public companies: any[] = [
    { "id": 0, "name": "Available" },
    { "id": 1, "name": "Ready" },
    { "id": 2, "name": "Started" }
];

in file.component.html :

<tbody>
  <tr *ngFor="let item of companies; let i =index">
     <td>{{i}}</td>
     <td>{{item.name}}</td>
  </tr>
</tbody>
Günter Zöchbauer :

Add BrowserModule to imports: [] in @NgModule() if it's the root module (AppModule), otherwise the CommonModule.

// older Angular versions
// import {BrowserModule, CommonModule} from '@angular/common';

import { BrowserModule } from '@angular/platform-browser'
..
..
@NgModule({
  imports: [BrowserModule, /* or CommonModule */],
  ..
})

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Can't bind to 'ngForOf' since it isn't a known property of 'tr'

ngForOf' since it isn't a known property of 'tr'

Can't bind to 'ngForOf' since it isn't a known property of 'tr'. CommonModule and BrowserModule are imported

Can't bind to 'ngForOf' since it isn't a known property of 'tr' in Angular 9

Can't bind to 'character' since it isn't a known property of 'tr'

Can't bind to 'ngForFor' since it isn't a known property of '<tr>'

Can't bind to 'ngForOf' since it isn't a known property of 'ng-container'

Can't bind to 'ngForOf' since it isn't a known property of 'li' Angular 9

How to fix "Can't bind to 'ngForOf' since it isn't a known property of <child component>" if ContentChildren used

Can't bind to 'ngForOf' since it isn't a known property of 'div'. when ever make change in html files

Error: Can't bind to 'ngForOf' since it isn't a known property of 'div'

Angular 10 Can't bind to 'ngForOf' since it isn't a known property of 'option'

Warning in console Angular 9: Can't bind to 'ngForOf' since it isn't a known property of 'li'

Can't bind to 'ngForOf' since it isn't a known property of 'li' in ngFor Angular

Template parse errors -> Can't bind to 'ngforOf' since it isn't a known property of 'ion-item'

Can't bind to property since it isn't a known property of a component

Can't bind to 'property' since it isn't a known property of 'component'

Can't bind to 'startingCategory' since it isn't a known property of 'div'

Can't bind to 'mdDatepicker' since it isn't a known property of 'input'

Can't bind to 'ngModel' since it isn't a known property of 'input'?

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

Can't bind to 'formControl' since it isn't a known property of 'select'

Can't bind to 'errorStateMatcher' since it isn't a known property of 'input'

Can't bind to 'ngModel' since it isn't a known property of 'input'

Can't bind to 'ngModel' since it isn't a known property of 'input'

Can't bind to 'ngValue' since it isn't a known property of 'option'

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

Can't bind to 'shouldLabelFloat' since it isn't a known property of 'input'

Can't bind to 'routerLink' since it isn't a known property of 'a'