With webclipse 1.8.3.201, when using a ngFor and a function to get iterable objects, the type/fields of iterable objects isn’t recognized. It works fine if the iterable objects are get with a field.
// Typescript code is just for an example, doesn’t make sense. In practice a sort was applied in the function.
export class Audit {
constructor(
public principal: string,
public timestamp: string,
public type: string
) { }
}
export class AuditsComponent {
audits: Audit[];
getAudits() {
return audits;
}
getAuditsTyped(): Audit[] {
return audits;
}
}
Websclipse doesn’t identify audit class when getAudits() is used:
<tr *ngFor=”let audit of getAudits()”>
<td>{{audit.type}}</td>
</tr>
Websclipse doesn’t identify audit class when getAuditsTyped() is used:
<tr *ngFor=”let audit of getAuditsTyped()”>
<td>{{audit.type}}</td>
</tr>
Websclipse identifies well audit class when a field is used instead of a function:
<tr *ngFor=”let audit of audits”>
<td>{{audit.type}}</td>
</tr>