I have a an ASP.NET MVC 5 application with AngularJS.
Some pages requires data from server, which I load using $http provider. But it has a big delay while it is waiting for an answer. For example, I return page from the server, on this page I have Foo Angular controller which firstly makes GET request to server and then my data is parsed into table. While this request is performing I can see template html which then results in normal table.
I found that most solutions uses Angular Routing, but in my case it is not a good way, because it is not really a SPA.
I tried this solution, but also without any real good results.
So, is it possible to load data from the server when my controller starts without using Angular Routing?
UPDATE
Here are screens which can show the problem.
When the main page is loaded I see this:
Then, after few some time I can see the resulting page with angular processing:
Original request which performs at this time:
The problem is next: is it possible to not show table layout (first screen) while angular retrieve data from server?
$http
. If your question is about the long delay - there is not enough information in the question to answer this. Look into the network traffic in Chrome dev tools - perhaps it takes a long time for the server to reply. Also, perhaps you have lots of data and takes time render... In other, there is not nearly enough information in the question.ng-cloak
should address itng-cloak
is my solution