Dart implementation of Angular 2 directive ngFor generating error


The following compile time error is generated when trying to use the ngFor directive in the Dart implementation of Angular 2 Beta 0.

Property binding ngForOf not used by any directive on an embedded  template ("[ERROR ->]
<div *ngFor="#item of items">


library design;

import 'package:angular2/angular2.dart';

    selector: 'design-component',
    templateUrl: 'design.html',
    viewProviders: const [CORE_DIRECTIVES]
class DesignComponent {
   List<String> items = ["One", "Two", "Three"];


<div *ngFor="#item of items">

Any suggestions or help would be appreciated.


viewProviders should be directives. viewProviders are for dependency injection.

Answered By – Günter Zöchbauer

Answer Checked By – David Goodson (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published.