API Docs for: 0.8.3
Show:

Models.common Class

Access point: ac.models.* Addon that provides access to the models collection

Item Index

Methods

Methods

expose

(
  • modelName
  • model
)

Expose a model instance as global. On the server side this means any mojit instance under a particular request will have access to the model. On the client, any mojit instance on the page will have access to the model as well.

Parameters:

  • modelName String

    The model name.

  • model Object

    Optional model instance, if not present, the instance will be lookup by modelName.

get

(
  • modelName
)
Object

Gets model instance

Parameters:

  • modelName String

    The model's logical name (filename minus the affinity and context parts).

Returns:

Object: contextualized model instance, or null.

set

(
  • modelName
  • model
)

set a model instance at the mojit instance.

Parameters:

  • modelName String

    The model name.

  • model Object

    The model instance.