-2

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?

0

2 Answers 2

1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

I use resolve like your link but remember that I have a dependency resolver for requirejs. how can I compose these promises?
0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.