-
Notifications
You must be signed in to change notification settings - Fork 0
Hello World App
adomado edited this page Jul 31, 2011
·
12 revisions
In this tutorial, I will quickly introduce you to the API which you will need to create Apps for the AdoMado Apps Platform.
A few quick points to remember, before planning your App
- jQuery is always available to your app as $j
- Your App exposes a set of callbacks which are called as and when a user interacts with your App
- The App is run within the scope of a self executing function, hence you are free to define any variables in your namespace.
- Your scope contains an object - config - which you can use to access the API object instance
- Each App is accompanied by a manifest file which defines rules about how the Apps Platform should load your App
Instead of making you read the API documentation, lets start straight by creating the ubiquitous Hello World App. The objective will be to quickly introduce you to the API.
(function(config) {
var HelloWorld = { // Start
init : function() {
config.api.log("Hello, World!");
},
options : function() {
config.api.log("Options!");
},
contextAction : function() {
config.api.log("Context action invoked");
}
}; // HelloWorld End
config.api.callbacks({
init : HelloWorld.init,
options : HelloWorld.options,
contextAction : HelloWorld.contextAction
});
})({
api : new IJAppApi.v1({appId : "__APP_ID__"})
});