I have a large form that functions on older PCs. This form is a component of a thin client system and is implemented using AngularJS to create a Single Page Application. One of the tabs on the SPA includes this form.
Upon opening the form, requests are sent to the backend to retrieve data. Based on the responses, AngularJS utilizes the ngIf
and ngShow
directives to dynamically build the form.
The lifecycle of this process is as follows: 1) Retrieve permissions and data 2) Render specific fields (based on permissions) using the retrieved data
The form consists of approximately 150 fields, which can cause some delay as the browser renders around 80-100 components. However, this is not the issue being discussed in this post...
There is a glass pane overlay on the form, which should be displayed until the form is fully loaded. The challenge lies in controlling the visibility of the glass pane only upon certain actions. The current approach involves:
- Enable the glass pane
- Initiate data and permissions API requests
- Receive responses from the API requests
- Disable the glass pane
- Render fields based on permissions
The issue arises when the browser continues rendering fields after the glass pane has been disabled.
Is there a way to disable the glass pane after the browser has completed rendering the DOM?
The code snippet in question is:
makePermissionsRequest().then(function (permissionsModel) {
$scope.permissionsModel = permissionsModel;
});