Main entry point to mojo-based applications. Not very complex - just some glue to help bootstrap your application.
npm install mojo-application
nodeFactory- the node factory to use when creating elements. This is automatically set when undefined.
// node factoryvar nofactor =Application = ;// use the DOM node factory - meant for the browservar app = nodeFactory: nofactordom ;// use the string node factory - meant for node.jsvar app = nodeFactory: nofactorstring ;// use the default node factory - automatically identified based on platform.var app = nodeFactory: nofactor"default" ;
the node factory to use when creating elements. This allows us to run on multiple platforms.
Array of plugins to use in the application.
var Application = ;var MyApplication = Application;var app = ;
registers a plugin to the application.
var Application = ;var app = ;// load in a third-party pluginapp;// or pass in a functionapp;
Initializes the application. This is where you should pass-in your app config, including what element to attach to.
Note that an exception will be thrown if initialize is called more than once.
var app = ;app;app;
called immediately before initializing your application.
called immediately after initializing your application. Good place to start your application.
var MyApplication = Application;var app = ;app;
initialize- emitted when the application is initialized