In my Angular application, I have a page that loads initially. When I click on the "Change" button, it triggers a function:
ng-click = "changeFunction()"
This function re-evaluates and updates the content of the page, especially in areas like {{textVariables}}
and images.
If only a small portion of the page is changed, the transition is quick and seamless. However, if there are significant changes, the button appears to be pressed for an extended period, creating the illusion that something is broken (even though it's just taking time to update).
How can I modify my changeFunction() in the Angular controller to set a flag as true when the updating process begins, and then back to false once it's completed? This way, I can use the flag to indicate to the user that changes are being made.
Just looking for guidance on the JavaScript aspect of the code; I'll handle designing the UI elements separately.