InputElement not updating with value

Discussão em 'Angular' iniciado por Himanshu1983, Março 31, 2025.

  1. Himanshu1983

    Himanshu1983 Guest

    I am facing a strange issue. I have two similar InputElement in my HTML form. I bind/assign the values to both of them in similar way. However, when I update the binding variable during the execution of the program, one of them gets updated and visible on screen while other does not. I tried changing the bindings, using ngModel but result is the same, Can't figure out what am I doing wrong.

    Below is the declaration of InputElement which gets updated correctly.

    <input type="number" #reference class="height-20 counter-container" id="speedId" prevValue="0.0" value="{{speed}}">

    The below declaration of Input which does not get updated properly.

    <input type="number" id="presettype" prevValue="0" #preset class="preset-input" value="{{preset}}" />

    I update these both in similar way in the .ts file.

    this.speed = value1; this.preset = value2;

    But speed gets updated and shown on UI properly, while preset field remains empty.

    What could be the possible fix?

    Continue reading...

Compartilhe esta Página