I use RequireJS with AngularJS for lazy loading. it works correctly but my view appear before fetching data from database. what is the problem? How can I solve this problem?
2 Answers
You are fetching data asynchronously, that is why this is happening. You can always display a "loading" overlay if you don't want the user to click anything while you load data.
If you want sync load, look here
But imho it is more user friendly that you tell the user something is going on (via loader popup or something similar) rather than just freezing the application while data loads.
1 Comment
I believe you're referring to template showing before the actual data (funky curly braces), aren't you?
If so, there is the directive (more of a class, actually) which you could apply: ngHide