Fork me on GitHub
Show:

config

Extends aeris.Model
Defined in: ../src/config.js:8

static

Summary

Global configuration object for Aeris.js library.

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.

Parameters:

clone

Syntax

clone

(
  • opt_attrs
  • opt_options
)
Model

Summary

Create a copy of the model.

Parameters:

  • opt_attrs Object=

    Attributes to set on the cloned model.

  • opt_options Object=

    Options to pass to cloned mode.

Returns:

fetch

Syntax

fetch

()

Summary

Fetch model data.

get

Syntax

get

(
  • attribute
)
* protected

Summary

Parameters:

Returns:

*:

getAtPath

Syntax

getAtPath

(
  • path
)
*|undefined

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:

Returns:

has

Syntax

has

() Boolean protected

Summary

Returns:

isValid

Syntax

isValid

()

Summary

Validate the model's attributes.

normalize_

Syntax

normalize_

(
  • attrs
)
Attrs protected

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:

Returns:

Attrs:

Normalized attrs.

off

Syntax

off

()

on

Syntax

on

()

Summary

Bind an event handler to the object. See Backbone.Events#on

onValidationError_

Syntax

onValidationError_

(
  • model
  • error
)
private

Summary

Handle 'invalid' events thrown by the model.

Parameters:

Syntax

() protected

Summary

parse

Syntax

parse

() protected

Summary

proxyEvents

Syntax

proxyEvents

(
  • obj
  • =}
  • opt_ctx
)
protected

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:

  • obj Events=

    The object to proxy.

  • =} Function(string, Array):Object

    opt_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_ctx Object=

    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

Inherited from Backbone.Model but overwritten in ../src/model.js:129

Syntax

set

(
  • config
)
protected

Summary

Normalize attributes before setting

Parameters:

setApiId

Defined in ../src/config.js:91

Syntax

setApiId

(
  • apiId
)

Summary

Parameters:

setApiSecret

Defined in ../src/config.js:99

Syntax

setApiSecret

(
  • setApiSecret
)

Summary

Parameters:

setStrategy_

Defined in ../src/config.js:76

Syntax

setStrategy_

(
  • strategy
)
private

Summary

Parameters:

sync

Inherited from Backbone.Model but overwritten in ../src/model.js:360

Syntax

sync

(
  • method
  • model
  • options
)
protected

Summary

Parameters:

toJSON

Syntax

toJSON

() Object

Summary

Returns:

Object:

A shallow copy of the model's attributes.

unset

Syntax

unset

(
  • attribute
)
protected

Summary

Parameters:

updateWithAttributesOf_

Syntax

updateWithAttributesOf_

(
  • target
  • attrs
)
private

Summary

Update the attributes of the model with attributes from another model.

Parameters:

validate

Inherited from Backbone.Model but overwritten in ../src/config.js:65

Syntax

validate

()

Summary

Properties

attributes

Syntax

attributes

Object protected

Summary

cid

Syntax

cid

Number | String protected

Summary

defaults

Inherited from Backbone.Model but overwritten in ../src/model.js:42

Syntax

defaults

Unknown

Summary

id

Syntax

id

Number | String protected

Summary

idAttribute

Inherited from Backbone.Model but overwritten in ../src/model.js:36

Syntax

idAttribute

Unknown

Summary

options_

Syntax

options_

Object private

Summary

The options used when constructing the model.

Attributes

apiId

string

Defined in ../src/config.js:26

Aeris API id.

apiSecret

string

Defined in ../src/config.js:32

Aeris API secret.

assetPath

string

Defined in ../src/config.js:38

Base url

strategy

string

Defined in ../src/config.js:19

The map type strategy used to load in map rendering components.

Events

add

Syntax

add

Summary

When a model is added to a {aeris.Collection}.

Event Payload:

change

Syntax

change

Summary

When a model's attribute changes

Event Payload:

change:[attribute]

Syntax

change:[attribute]

Summary

When a model's attribute changes, where [attribute] is the name of the attribute.

Event Payload:

remove

Syntax

remove

Summary

When a model is removed from a {aeris.Collection}.

Event Payload: