API Docs for: 0.9.0
Show:

Partial.common Class

Access point: ac.partial.* Provides methods for working with "actions" and "views" on the current Mojits.

Item Index

Methods

Methods

invoke

(
  • action
  • options
  • propagateFailure
  • params
  • route
  • url
  • body
  • file
  • cb
)

This method calls the current mojit's controller with the "action" given and returns its output via the callback.

Parameters:

  • action String

    name of the action to invoke.

  • options Object

    a literal object with the configuration

  • propagateFailure Boolean

    whether or not errors invoke should affect the original action by calling adapter.error

  • params Object

    optional object to be passed as params in the invoke command. It defaults to the current action params.

  • route Object

    Map of key/value pairs.

  • url Object

    Map of key/value pairs.

  • body Object

    Map of key/value pairs.

  • file Object

    Map of key/value pairs.

  • cb Function

    callback function to be called on completion.

render

(
  • data
  • view
  • cb
)

This method renders the "data" provided into the "view" specified. The "view" must be the name of one of the files in the current Mojits "views" folder. Returns via the callback.

Parameters:

  • data Object

    The object to be rendered.

  • view String

    The view name to be used for rendering.

  • cb Function

    callback signature is function(error, result).