SimpleProperty

SimpleProperty

Kind: global class

SimpleProperty(value, options)

A Simple Property is an object that stores (without bindings) the property metadata of a class.

ParamTypeDefaultDescription
value*

The default value of the property

optionsObject

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

ParamTypeDescription
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

ParamTypeDefaultDescription
objectObject

The prototype of the class, or an instance of it

pNameString

The name of the property

optionsObject

Additional options

[options.readOnly]booleanfalse

Allows to disable direct set (error thrown) but property is bindable to ther properties, like a private one

[options.immutable]booleanfalse

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