Search code examples
angulartypescriptrepeat

How to use variable based on function parameter received in TypeScript?


How can I do this using only three lines instead of same three lines in 3 if statements?

code


Solution

  • You could do something like I did in the updateValues method: https://stackblitz.com/edit/angular-ivy-xkjmav?file=src/app/app.component.ts