-
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
Controller not getting loaded #164
Comments
Hi, if you want to see the errors, you should add success & error callbacks to the load function (I should write this in the docs):
Then the problem here is probably that in your loginController.js file you reference "FrontEnd" but the global variable is probably not available in your file. Change it to: angular.module("FrontEnd").controller('LoginController', function() {
console.log("In Login Controller");
}); |
Thanks for reply. But its still not working.:( I tried to console error with your code. But still not showing any errors. |
OK, does an element with the id #ng_load_plugins_before really exist in Also, what versions of angular and ocLazyLoad do you use? |
Yes, DOM includes element with id #ng_load_plugins_before. No, I checked, controller file is not being loaded. Using angular's v3.1.15 and ocLazyLoads v0.5.1. |
Can you look into it using team viewer. Because I am fed up with it since last two days and its very urgent. |
I'm making a plunkr to reproduce the bug |
Ok, if I remove "insertBefore: '#ng_load_plugins_before'" it works. You can use this for now (unless this parameter is really really necessary for you?), I need to check why "insertBefore" isn't working. |
Yes boss. Thank you very much. "insertBefore" is not working. Its not that much necessary for me but wanted to keep my controllers file above particular div. But let me know if you resolve the issue of insertBefore. Once again thanks.:) |
I'm using |
But getting this error in console: SyntaxError: expected expression, got '<'. If I manually load LoginController.js into layout it works fine. And I checked in dom its not getting included in DOM but in Network its showing js is being loaded. |
Here is a working version of your code (I might have changed a few file names/urls to make it work on plunkr): http://plnkr.co/edit/tqDGVCaRU3qI4EBWJsil?p=preview |
Mistakenly closed issue...Sorry..:( |
I got where is the issue. I am using this in zend. Lazyloader sending request for loading LoginController.js. But Zend is unable to find the request so its throwing an error: Do you know what may be solution for it? |
Hu no, that's a php issue on your server, I don't think it has anything to do with ocLazyLoad |
Thanks. But if you resolve issue of "insertBefore" please let me know. |
Hi, I resolved issue with zend. Your plugin working like charm. Thanks. Plz let me know once you fix the issue of "insertBefore"..Cheers...! |
Yes I'll let you know |
Ok it's fixed in 1.0.0-beta.1. |
I still have this issue. Code tries to find the anchor in head tags but I need to load script in body. I tried in 1.0.0-beta.2 |
Do you have an error message @burakkilic ? |
I am getting following error:
My code is:
And tag in the tags is
|
Can you type: document.querySelector('#load_controllers_before'); in your console, and check if it finds the node in your webpage ? |
Yes, it finds. |
OK found the issue, I'm searching for the node in head like you said, instead of taking the parent of the selector... :-/ |
Thank you. Waiting for the news:) |
Fixed :) |
Thanks dude..:) |
Hi, I am using version v1.0.9 and I am still getting the error: SyntaxError: expected expression, got '<' Here is my function: $stateProvider |
hi ok... you should write the element in head section of html page |
if the problem persists, note that you have to define module name in lazy load returned object, i.e: loadMyCtrl: ['$ocLazyLoad', function ($ocLazyLoad) { |
Hi every one, |
@benallamar can you show your code? |
@justgeek thank you for your answer |
@benallamar did you try using it without deps ? I mean put depencies elsewhere, what is serie:true ? |
File is loading but shows controller is undefined .state('login', { app.config(['$ocLazyLoadProvider', Using angular 1.4.8 & oclazyload 1.0.0 beta 1 |
I have written one controlller js LoginController.js. I want include it only for login state. So i have written code in app.js like
And my LoginController.js is:
For now I am trying only to see where it comes in controller or not. When I directly include my LoginController.js in layout, it works perfectly but when I try with loading using lazy loader it gives me blank screen. It does not show even any error in console. Please help me out, its urgent. Using version 0.5.1.
Thanks.
The text was updated successfully, but these errors were encountered: