ngFor: If a function get iterable objects, class of iterables isn't recognized

This topic contains 2 replies, has 3 voices, and was last updated by Profile photo of Brian Fernandes Brian Fernandes 2 weeks, 3 days ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #536206 Reply
    Profile photo of ber000
    ber000
    Participant

    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>

    #536376 Reply
    Profile photo of support-swapna
    support-swapna
    Moderator

    ber000,

    Thank you for the example code. I could replicate the validation problem when using the function in ngFor.
    The dev team is looking into it. We will keep you posted when the fix is out.

    Thank you for reporting it.

    –Swapna
    MyEclipse Support

    #541929 Reply
    Profile photo of Brian Fernandes
    Brian Fernandes
    Moderator

    This issue has been fixed for the 2017 CI 9 release, that’s due in the next few days.

    We did put out a pre-release of CI 9 which does contain this fix, so if you would like to try it out immediately, please follow the instructions in this thread: https://www.genuitec.com/forums/topic/webclipse-angular-ide-prerelease-stream/

    If you do try out the pre release, do let us know if your issue was fixed, if not, we’ll hopefully be able to correct it before the final release.

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: ngFor: If a function get iterable objects, class of iterables isn't recognized