Skip to content

Built in Helper Functions

Bob Dickinson edited this page Aug 14, 2014 · 6 revisions

Synchro provides a number of built-in commands in the Synchro namespace. These are automatically made accessible to Synchro modules (no "require" is necessary).

Synchro.getResourceUrl(resource)

getResourceUrl uses the resource mapper provided in the Synchro application configuration to resolve resource names to full URLs that can be used to access those resources.

Synchro.navigateToView(context, route, params)

navigateToView provides for navigation between Synchro views. The route describes the path to the desired view, and params, if present, is an object that is passed to the IntializeViewModel function of the module being navigated to.

Synchro.showMessage(context, messageBox)

showMessage causes the client device to show a message using the native message/alert mechanism on the device.

!!! Outline structure and members of messageBox

Synchro.waitFor(fn, arguments)

waitFor allows for asynchronous calls to functions (asynchronous with respect to Node.js anyway). See docs for wait.for (!!! inline some of that and include an example here)

Clone this wiki locally