-
Notifications
You must be signed in to change notification settings - Fork 510
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: can I use $ocLazyLoad to load supplementary files to module that is already loaded? #41
Comments
Hmm you're right there is a bug here. I don't use requirejs because I find it redundant with Angular and ocLazyLoad does the job for lazy loading, that's why I sometimes miss that kind of bugs... In the mean time (until I fix this), you can declare your controller in a new module. |
Awesome! Thank you. But still, could you explain what is the meaning of the Also, I agree with redundancy. However, I still don't have a complete understanding how ocLazyLoad works, does it cache, does it use global scope or not? Requirejs is quite commonly used and all dependencies are injected into the local scopes, without being reinitialise (just for example) at the global. Perhaps I have to do some more practice without requirejs, before I can completely decide wether I need it or not. Thanks again. Will be keeping an eye one it. |
Yes, the name is used to find in which module the new elements are loaded. For the native loaders in ocLazyLoad: they uses cache by default but you can avoid it with a config parameter (more info in the docs). |
Fixed in 0.3.3 ! |
What i'm looking for is to be able to lazy-load everything. After following the readme and examples, i've ended up with this skel: http://plnkr.co/edit/5XOS1jAwJsdGHzlaJBNA?p=preview
However, when I try to lazy-load only controller, to already-loaded module, I hit the module reinitialisation error, basically state reinitialisation error. In the logs you see that
config
is executed twice. Error fades as soon as I removeloadedModules: ['app'],
line from theapp.js
file.I'm still uncertain if I understand the purpose of the
name
property when calling '$ocLazyLoad.load()` method. What is it meant to be doing?Thanks.
The text was updated successfully, but these errors were encountered: