Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
How to save Model data
var ModelMixin = {
get: function ( key , args ) {
var isFn = (typeof this[key] === 'function');
return isFn? this[key].apply(this,args): this[key] ;
}
,set: function ( key, value ) {
if(typeof key === 'string') {
this[key] = value;
return value;
}
for(i in key) {
this.set(i,key[i]);
}
return key;
}
};
var ModelMixin = {
_storage: {}
,get: function ( key , args ) {
var isFn = (typeof this[key] === 'function');
return isFn? this[key].apply(this,args): this._storage[key] ;
}
,set: function ( key, value ) {
var context;
if(typeof key === 'string') {
context = (typeof this[key] !== 'undefined') ? this : this._storage;
context[key] = value;
return value;
}
for(i in key) {
this.set(i,key[i]);
}
return key;
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.