How can i make the input change the ngFor item value?

Viewed 41

I have this array for example (got from the Sources tab in dev tools)

bodyParams = [
 0: {placeholder: "{{1}}"}
 1: {placeholder: "{{2}}"}
 2: {placeholder: "{{3}}"}
 3: {placeholder: "{{4}}"}
 4: {placeholder: "{{5}}"}
]

And this ngFor:

<div *ngFor="let item of bodyParams; let idx = index;">
    <wds-input
    [placeholder]="
        ('messages.generic.message_composer.template.sample_insert' | translate) + '{{' + (idx + 1) + '}\}'
    "
    ></wds-input>
</div>

For each item, the ngFor generates a input field to fill..

But i cant make the input value change the array placeholder value to do the replacement.

I tried to use [(ngModel)] but it didn't work.

0 Answers
Related