Skip to content
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

issue on IE browser rendr app : Undefined modelName for model #415

Open
a10101992 opened this issue Nov 26, 2014 · 2 comments
Open

issue on IE browser rendr app : Undefined modelName for model #415

a10101992 opened this issue Nov 26, 2014 · 2 comments

Comments

@a10101992
Copy link

I have used rendr app . But it is not working IE browser as i include

<!--[if lte IE 9]>

 <script src="http://code.jquery.com/jquery-1.9.0.js"></script>
  <script src="http://code.jquery.com/jquery-migrate-1.2.1.js"></script>

<![endif]-->

<!--[if !IE]> -->

<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>

as well as this one also
https://github.com/es-shims/es5-shim

And I am facing following issue IE browser
: Undefined modelName for model

here is code for issue is coming up .

ModelStore.prototype = Object.create(Super.prototype);
ModelStore.prototype.constructor = ModelStore;

ModelStore.prototype.set = function(model) {
var existingAttrs, id, key, modelName, newAttrs;

id = model.get(model.idAttribute);
modelName = this.modelUtils.modelName(model.constructor);
if (modelName == null) {
throw new Error('Undefined modelName for model');
}

@mikepuerto
Copy link

the issue here is that when modelName is returned as an empty string, IE doesn't see it as a string, it is undefined. We monkey patched it so that f (modelName == null) { used a strict check, f (modelName === null) {

@Eiryyy
Copy link

Eiryyy commented Nov 13, 2015

modelUtils.modelName is below.

ModelUtils.prototype.modelName = function(modelOrCollectionClass) {
  return this.underscorize(modelOrCollectionClass.id || modelOrCollectionClass.name);
};

But Function.prototype.name is unsupported by IE. (ES2015 standard), should be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants