i have been strungling to find the right way to do a really basic thing in angular.
Most of the time it's when i want to display a loader when something takes time, i have a isLoading variable that i switch to true on the start of the function and to false at the end.
In between those i usually have a for loop that takes time because of the amount of data ( i can't change that ) the variable do change in the browser's console but not in the UI.
I've made a basic setup on stackblitz to show what is happening
When you click on the button the square should turn red while the loop is still looping because of the ngifs, but nothing happens on the UI.
I used to use a setTimeout but is there a good practise for how to do this ? Or am i doing something wrong here?