Added target attribute support. Ignite Object now supports setProperties. Added null check for props. Fixed some documentation wording.
This commit is contained in:
@ -402,6 +402,23 @@ class IgniteObject {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the values of properties on this ignite object.
|
||||
* @param {Object|IgniteObject} props The properties to set onto this ignite object.
|
||||
*/
|
||||
setProperties(props) {
|
||||
if (props == null || props == undefined) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (props instanceof IgniteObject) {
|
||||
props.update();
|
||||
Object.getOwnPropertyNames(props).forEach(name => this[name] = props[name]);
|
||||
} else {
|
||||
Object.keys(props).forEach(name => this[name] = props[name]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an IgniteObject or Array of IgniteObjects and returns it.
|
||||
* @param {Object|Array} obj The object to create an IgniteObject from.
|
||||
|
Reference in New Issue
Block a user