问题
I have tried to save an object to database:
Item = persistence.define('Item', {
imageUrl: "TEXT",
})
this is working,the imageUrl is set correctly:
var c = new Item({imageUrl: "a"});
this is not working, imageUrl is empty in the db
var c = new Item();
c.imageUrl = "a";
this is working:
var c = new Item();
c._data.imageUrl = "a";
Seems like a bug.
回答1:
I think I found the reason, If you are using jquery then you have to use: e. g.
obj.name(newValue)
to set and
obj.name()
to get attributs.
Can you please tell me where the documentation for such cases can be found? https://groups.google.com/forum/?fromgroups=#!topic/persistencejs/zph_wV1sEic
来源:https://stackoverflow.com/questions/13126293/persistence-js-add-function-not-working