API Docs for:
Show:

App

Defined in: js/app.js:22
Module: App

Summary

The App class defines the main object of the applications

Constructor

App

Defined in js/app.js:22

Syntax

App

(
  • options
)
private

Summary

Parameters:

  • options Object

    An object defining options for the application.

    • views - An array with a list of view names

Item Index

Methods

back

Defined in js/app.js:129

Syntax

back

() chainable

Summary

Go to the previous view in the history

Returns:

Route

Example:

m.app.back();

go

Defined in js/app.js:94

Syntax

go

(
  • url
)

Summary

Go to an url

Parameters:

  • url String

    The url to go

Returns:

Route

Example:

m.app.go("/product/15/");

on

Defined in js/app.js:143

Syntax

on

() chainable

Summary

Set callbacks for app events

Returns:

App instance

Example:

m.app.on("ready", function(self) {
    console.log("App started.");
});

settings

Defined in js/app.js:70

Syntax

settings

(
  • key
  • [value]
)

Summary

Application settings If called with a key, returns the value. If called with key and value, sets value to key.

Parameters:

  • key String

    The name of the setting

  • [value] Object optional

    The value of the setting

Returns:

object the setting value

Example:

m.app.settings("debug", true);
if (m.app.settings("debug") === true) {
     console.log("Debug mode activated.");
}

version

Defined in js/app.js:50

Syntax

version

(
  • [version]
)
String

Summary

The application's version number Note: It's not Mootor version, this value is defined in application code, not framework code.

Parameters:

  • [version] String optional

    The version number or name

Returns:

String:

Version number or name

Example:

m.app.version("beta1");
if (m.app.version().indexOf("beta") > -1) {
    console.log("Warning: beta version")
}

view

Provided by the View module.

Defined in js/view.js:272

Syntax

view

(
  • id
  • [options]
)

Summary

Create or get a view

Parameters:

  • id String

    The id of the view

  • [options] String optional

    The options object for the view

Returns:

View the referenced view object

Example:

indexView = m.app.view("index");