App

App The App class is the logical core unit of every InfrontJS application.

Constructor

new App(containeropt, settingsopt)

Create an app instance

Parameters:
NameTypeAttributesDefaultDescription
containerHTMLElement<optional>
document.body

The root container of the application.

settingsobject<optional>

Application settings object.

Properties
NameTypeAttributesDescription
appobject<optional>

App settings.

Properties
NameTypeAttributesDefaultDescription
titlestring | null<optional>
null

App's title, if set it will be set to the title header value.

idstring | null<optional>
null

Unique id of app instance. If not set, it will be auto generated.

Methods

(async) destroy() → {Promise.<void>}

Destorys InfrontJS application instance

Returns:
Type: 
Promise.<void>

getVersion() → {string}

Get InfrontJS version

Returns:
  • Version string
Type: 
string

(async) run(routeopt) → {Promise.<void>}

Run application logic. This activates the InfrontJS application logic. Note: This is an asynchronous function providing the possibility to e.g. loading assets etc.

Parameters:
NameTypeAttributesDefaultDescription
routestring | null<optional>
null

If route is set, this route is set initially.

Returns:
Type: 
Promise.<void>

(static) get(uid) → {App|null}

Parameters:
NameTypeDefaultDescription
uidstring | nullnull

Get instance by given uid. If no uid is given, the first app from pool is returned.

Returns:
Type: 
App | null