How do I declare a temporary variable in angular html component?

Discussão em 'Angular' iniciado por Anthony Cuartero, Janeiro 14, 2025.

  1. I am trying to call a function inside a loop.

    How do I call a function and store the return value as temporary variable?

    I need to use the return value to display.

    Sample below code I want to achieve.

    <div *ngFor="let list of sampleLists">
    <div >
    {{ var result = getMyFunction(list) }}

    <div>
    {{ result.Value}}
    {{ result.Name}}
    </div>
    </div>
    </div>

    Continue reading...

Compartilhe esta Página