-
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
IE 8 incompatibility due to indexOf usage #52
Comments
I should be able to work around by using something else, but you can easily |
I ended up just adding the following to the top, but figured you may have a preferred way. It's otherwise compatible with IE8 (at least so far as I have experienced) if (!Array.prototype.indexOf)
{
Array.prototype.indexOf = function(elt /*, from*/)
{
var len = this.length >>> 0;
var from = Number(arguments[1]) || 0;
from = (from < 0)
? Math.ceil(from)
: Math.floor(from);
if (from < 0)
from += len;
for (; from < len; from++)
{
if (from in this &&
this[from] === elt)
return from;
}
return -1;
};
} |
Ok thanks. I'll see what I can do after my holydays :-) |
Yes but not until next week |
sure! enjoy your vacations! |
@vikashait your log points to a call to an unloaded module, any chance to get your code to see where the error is ? |
Here is my main.js file (using requireJS)
Here is my config file....
|
Basically I used both requirejs to configure js dependencies and then used iui-router with your library |
Ok thanks I'll check this tomorrow ! |
Thanks |
Ok I see something weird in your code, you are trying to lazy load the mainApp module in the mainApp module: return $ocLazyLoad.load({
name: 'mainApp',
files: [
'assets/javascripts/modules/mainApp.js',
'assets/javascripts/controllers/mainCtrl.js',
'assets/javascripts/services/Props.js',
'assets/javascripts/services/JsonService.js',
'assets/javascripts/services/TemplateManager.js',
'assets/javascripts/directives/simpleProperty.js',
'assets/javascripts/directives/uriProperty.js',
'assets/javascripts/directives/multiplevaluesProperty.js',
'assets/javascripts/directives/structProperty.js',
'assets/javascripts/directives/valueArrayProperty.js',
'assets/javascripts/directives/aspect.js',
'assets/javascripts/directives/entity.js'
]}); The first line It may work anyway because the lib tries not to reload something already loaded (unless you explicitly ask it), but it's worth mentioning even if I don't think it's the error here. When I look at the log that you provided, it seems that it throws the error when you are bootstrapping the app (when the app is first loading). It's more probable that the problem is in the requirejs config, but I'm no expert here and I don't have all the files so I'm not sure what is wrong... Take a look at https://github.com/kbdaitch/ui-router-lazy-example/tree/gh-pages it may help you configure your project correctly. |
Ok I removed 'assets/javascripts/modules/mainApp.js', entry but as you mentioned problem is still there.. I will look into the link and will try to see where the problem is and will update you. thanks |
Could you try version 0.3.6 and tell me if it works with it please ? |
My Issue was fixed in 0.3.6 by the way. Thanks! |
Ok, what about you @vikashait ? |
I'm closing this now due to inactivity, add a comment if you need to have it reopened. |
At the moment lazy load is incompatible with IE8 due to use of indexOf. Could a workaround be added, maybe just a simple implementation of Array.prototype.indexOf?
The text was updated successfully, but these errors were encountered: