forked from codemix/oriento
-
Notifications
You must be signed in to change notification settings - Fork 0
Properties
Giraldo Rosales edited this page Apr 23, 2014
·
1 revision
Listing properties in a class
Class.property.list();Response:
- list (Array) - List of properties.
Example:
MyClass.property.list()
.then(function(properties) {
console.log('The class has the following properties:', properties);
});## Add Adding a property to a class. ```javascript Class.property.create(config); ```
Parameters:
- config (Object) - Property name and value.
Response:
- results (Boolean) - If property was deleted, returns true. Otherwise false.
Example:
MyClass.property.create({
name: 'name',
type: 'String'
})
.then(function() {
console.log('Property created.');
});## Delete Deleting a property from a class ```javascript Class.property.delete(name); ```
Parameters:
- name (String) - Property name to delete.
Response:
- results (Boolean) - If property was deleted, returns true. Otherwise false.
Example:
MyClass.property.delete('myprop')
.then(function() {
console.log('Property deleted.');
});