First page Back Continue Last page Graphics
The "default.js" file
- "require.js" is used to load the JavaScript files on demand. In the <head> section, when this script is loaded, the "data-main" attribute defines which JavaScript file to load first. By default, that file is named "default.js" and resides in you App’s folder, the same as your "default.html" file. This file should contain the following.
- The "require()" declaration, which lists the dependencies of your app. This will include "angular", "SIMRacingApps", and your default.css file as a minimum. It should also list all widgets your app uses.
- The "controller" for your app is used to initialize variables you are using in your default.html file and also to load the translation files.
- A call bootstrap the application as follows, (element,width,height,font-size). These must match the values from the listing.json file.
SIMRacingApps.start(angular.element(document.body),800,480,16);