javascript - Unblocking AngularJS UI -


I have an AngularJS app My app allows the user to enter and execute a number. When the execution button is pressed, then I am dynamically creating an array for processing. While the array is being created, the UI seems locked. I have the following:

  & lt; Input type = "text" ng-model = "numToExecute" & gt; & Lt; / Input & gt; & Lt; Button class = "btn btn-primary" ng-click = "execution ()" & gt; Execute & lt; / Button & gt; & Lt; Div class = "alert alert-info" role = "alert" ng-if = "building array === true" & gt; & Lt; Strong & gt; Building Array & lt; / Strong> & Lt; Br / & gt; & Lt; / Div & gt; $ Scope.preloadedItems = loadArray (); $ Scope.executeTests = function () {$ scope.buildingArray = true; Var i = 0; Angular.forEach ($ scope.preloadedItems, function (item) {if (i & lt; numToExecute) {$ scope.myArray.push ({id: item.id})}} i = i + 1;}); $ Scope.buildingArray = false; $ Scope.processArray (); };  

The box says, "Building Array" never happens, like it puts the EUE to ankl. It is done for each statement. There are thousands of entries in the preloadedItems array, this is the reason why I want to show the "Building array" box.

Is there a way to unblock UI? Or, at least show the building array box?

Thank you!

put Angelor for $ timeout For the unit

  $ timeout (function (pre-$ (scope.preloadedItems, function (item) for cooner {if (i & lt; numToExecute) {$ scope.myArray Push ({Id: item.id});} i = i + 1;});}, 0)  

Comments

Popular posts from this blog

winforms - C# Form - Property Change -

java - Messages from .properties file do not display UTF-8 characters -

javascript - amcharts makechart not working -