简体   繁体   中英

why does my emberjs model throw an exception when i try calling deleteRecord on it

I am doing this tutorial and just when i thought i got everything right, I came across this exception

 JavaScript runtime error: Object doesn't support property or method 'deleteRecord'

in this context

removeTodo: function () {
        var todo = this.get('model');
        todo.deleteRecord();
        todo.save();
    }

i trying to follow the getting started tutorial on the Ember.js site .

It would appear that your model isn't actually a DS.Model (assuming that you're using Ember Data). Unless you're model is an actual record I'm ember, you won't be able to call delete record.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM