lit_yin
lit_yin

Reputation: 43

Is Ember data support ie8,if not,what can i do to fix it

DEBUG: ------------------------------- ember-1.9.1.js:3935
DEBUG: Ember      : 1.9.1 ember-1.9.1.js:3935
DEBUG: Ember Data : <%= versionStamp %> ember-1.9.1.js:3935
DEBUG: Handlebars : 2.0.0 ember-1.9.1.js:3935
DEBUG: jQuery     : 1.11.1 ember-1.9.1.js:3935
DEBUG: ------------------------------- 

it throw an error:"the object don't support the property or function" when i give the code blow:

Hwv.Login = DS.Model.extend({
    name: DS.attr('string'),
    password: DS.attr('string')
}); 

Hwv.LoginRoute = Ember.Route.extend({
    model:function(){
    debugger;
    var login = this.store.createRecord("login");//if i remove this row,it don't throw any error;
    debugger;
        // when it in this debugger,it don't throw any error;
        //but when all of the script runned completed,it just throw an error message like above;
    return login;
        //if i change 'return login' to 'return {}',the issue still appear;
    // return {};
    }
});

My ask:'Is Ember data support ie8,if not,what can i do to fix it.',thanks.

Upvotes: 0

Views: 390

Answers (1)

GJK
GJK

Reputation: 37379

Yes, Ember-Data does support IE8. The reason your code isn't working is because you're trying to directly access the store property instead of using Ember's getter function. IE8 doesn't support Javascript computed properties so you have to use Ember's. Change the offending line to this and it should be fine:

var login = this.get("store").createRecord("login");

Upvotes: 1

Related Questions