API Docs for: 0.3
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
  • cb
)

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

The options parameter is optional and may contain:

params
<object> must be broken out explicitly:
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.

Parameters:

  • action String

    name of the action to invoke.

  • options Object

    see above.

  • 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).