0

How can I declare variable that isn't coming from parent component? In this example rowData comes from p-column but I need to declare another variable.

<p-column *ngFor="let h of header">
    <template let-ms="rowData" pTemplate="body" let-m="getMetricByName(ms.metrics, h)">
                {{m.name}} //for example
    </template>
</p-column>
Illorian
  • 1,222
  • 2
  • 13
  • 38

1 Answers1

0

There is currently no way to declare variables in the template.

See also angular's ng-init alternative in Angular 2

This issue seems related https://github.com/angular/angular/issues/15020

Community
  • 1
  • 1
Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567