Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 67497

ngModel on button, buttons view reloads everytime i change its state

$
0
0

I have the following group of toggle-buttons:

<div *ngFor="let minute of state.minutes.specificMinutes.selectedMinutes | keyvalue">
  <div class="btn-group btn-group-toggle">
    <label class="btn btn-secondary" ngbButtonLabel>
      <input type="checkbox" (click)="state.minutes.subTab='specificMinutes'"
             [ngModel]="state.minutes.specificMinutes.selectedMinutes.get(minute.key)"
             (ngModelChange)="state.minutes.specificMinutes.selectedMinutes.set(minute.key, $event)"
             (change)="setCronMinutes()" ngbButton>{{minute.key}}
    </label>
 </div>
</div>

The problem is that the buttons view reloads everytime i change something, which results in annoying flickering like seen in this gif.

This is caused by

[ngModel]="state.minutes.specificMinutes.selectedMinutes.get(minute.key)"
(ngModelChange)="state.minutes.specificMinutes.selectedMinutes.set(minute.key, $event)"

But is there a way to keep that functionality without that flickering?


Viewing all articles
Browse latest Browse all 67497

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>