SimpleProperty
SimpleProperty
Kind: global class
SimpleProperty(value, options)
A Simple Property is an object that stores (without bindings) the property metadata of a class.
| Param | Type | Default | Description |
|---|---|---|---|
| value | * | The default value of the property | |
| options | Object | Additional options | |
| [options.set] | Setter | | Allows to override default setter of the property |
$$isaSimplePropertyClass
Flag to check if it is a property class
Kind: static property of SimpleProperty
declare(defaultValue, options) ⇒ ImageModel
Declare a new class that inherits from the one it was called
Kind: static method of SimpleProperty
Returns: ImageModel - An ImageModel instance
| Param | Type | Description |
|---|---|---|
| defaultValue | * | The simple property value |
| options | * | The simple property options |
Example
var MySimpleProperty = SimpleProperty.declare("MySimpleProperty", {});defineGetterAndSetter(object, pName, options, value)
Define the simple property getter/setter using the javascript defineProperty method (i.e. without bindings).
Kind: static method of SimpleProperty
| Param | Type | Default | Description |
|---|---|---|---|
| object | Object | The prototype of the class, or an instance of it | |
| pName | String | The name of the property | |
| options | Object | Additional options | |
| [options.readOnly] | boolean | false | Allows to disable direct set (error thrown) but property is bindable to ther properties, like a private one |
| [options.immutable] | boolean | false | Allows to define property as immutable (getter and setter disable, no watch) |
| [options.set] | Property~Setter | | Allows to override default setter of the property |
| value | * | Default value to return during asynchronous value computation |