config
Summary
Global configuration object for Aeris.js library.
Item Index
Methods
Properties
Events
Methods
bindAttributesTo
Syntax
bindAttributesTo
-
target -
attrs
Summary
Keep this model updated with values from the target model.
Immediately updates the model with the specified attributes, and updates this model whenever the target model's attributes change.
clone
Syntax
Summary
Create a copy of the model.
Parameters:
Returns:
fetch
Syntax
fetch
()
Summary
Fetch model data.
getAtPath
Syntax
Summary
Returns a deep-nested property of a model attribute.
Example: model.set('deepObj', { levelA: { levelB: { foo: 'bar' } } });
model.getAtPath('deepObj.levelA.levelB.foo'); // 'bar'
Returns undefined if the path cannot be resolved.
Parameters:
-
pathString
isValid
Syntax
isValid
()
Summary
Validate the model's attributes.
normalize_
Syntax
Summary
This method is called every time attributes are set on the model.
Override to provide any additional processing needed for options object structure, etc.
Parameters:
-
attrsObject
Returns:
Normalized attrs.
on
Syntax
on
()
Summary
Bind an event handler to the object. See Backbone.Events#on
onValidationError_
Syntax
onValidationError_
-
model -
error
Summary
Handle 'invalid' events thrown by the model.
Parameters:
-
modelModel -
errorValidationError
Syntax
Summary
parse
Syntax
parse
()
protected
Summary
proxyEvents
Syntax
proxyEvents
-
obj -
=} -
opt_ctx
Summary
Proxies all events from another {aeris.Event} object. In other words, all the events that you trigger, I'm gonna trigger too.
Passes along the original object as the first argument when triggering proxied events.
Parameters:
-
objEvents=The object to proxy.
-
=}Function(string, Array):Objectopt_callback A callback function to customize the proxied event. Should return on object with 'topic' and 'args' properties.
Example: parent.proxy(child, function(topic, args) { return { topic: 'child:' + topic, args: [child].concat(args) } }); ...would trigger all child events, with a topic prepended with 'child:', and with the child object inserted as the first argument. -
opt_ctxObject=A context in which to call the opt_callback function. Defaults to this.
removeProxy
Syntax
removeProxy
()
protected
Summary
End any proxies that have been wrapped around this {Events} object.
set
Syntax
set
-
config
Summary
Normalize attributes before setting
Parameters:
-
configObject
sync
Syntax
sync
-
method -
model -
options
Summary
Parameters:
-
methodString -
modelBackbone.Model -
optionsObject=
updateWithAttributesOf_
Syntax
updateWithAttributesOf_
-
target -
attrs
Summary
Update the attributes of the model with attributes from another model.
validate
Syntax
validate
()
Summary
Properties
defaults
Syntax
defaults
Unknown
Summary
idAttribute
Syntax
idAttribute
Unknown
Summary
Attributes
Events
add
Syntax
add
Summary
When a model is added to a {aeris.Collection}.
Event Payload:
-
modelaeris.Model -
collectionaeris.Collection
change:[attribute]
Syntax
change:[attribute]
Summary
When a model's attribute changes, where [attribute] is the name of the attribute.
Event Payload:
-
modelaeris.Model -
value
remove
Syntax
remove
Summary
When a model is removed from a {aeris.Collection}.
Event Payload:
-
modelaeris.Model -
collectionaeris.Collection