0

I'm using the td-data-table from the teradata/covalent framework but independet from the framework I'd like to use *ngFor in an like this:

<ng-template *ngFor="let column of columns" tdDataTableTemplate="{{column.name}}" let-value="value">
    <div>
        <span>{{value.content}}</span>
        <br>
        <span *ngIf="enabler">{{value.subContent}}</span>
    </div>
</ng-template>

I've read that the syntax for using *ngFor with an is different, so I've tried this:

<ng-template ngFor let-column [ngForOf]="columns" tdDataTableTemplate="{{column.name}}" let-value="value">
    <div>
        <span>{{value.content}}</span>
        <br>
        <span *ngIf="enabler">{{value.subContent}}</span>
    </div>
</ng-template>

Is it the framework which is preventing the code to work or have I written something wrong?

Leonzen
  • 1,195
  • 5
  • 13
  • 30
  • Is your template inside of a `` element? You shouldn't need an `ngFor` since the data table populates the rows for you. Maybe include the code wrapping your `` and the class properties that are being referenced. – Chic Sep 28 '17 at 15:01
  • Possible duplicate of [Angular 4.0 Teradata data-table ng-template for all columns](https://stackoverflow.com/questions/46483138/angular-4-0-teradata-data-table-ng-template-for-all-columns) – Chic Nov 15 '17 at 15:54

0 Answers0