O'Reilly logo

PhoneGap 3.x Mobile Application Development HOTSHOT by Kerri Shotts

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Putting it all together

We're almost there! We just need to put everything together with a couple of glue scripts, and then you can enjoy the app on your device!

Getting on with it

We need to define a few more short files to fill out the app, but once done, we'll have something that's ready to be built and deployed.

First, we need to define /www/js/app/main.js, as follows:

define ( ["yasmf", "app/views/noteListView"], function (_y, NoteListView ) {
   var APP = {};

Load the first view and initialize it (this will show the list of notes):

   APP.start = function () {

Find the rootContainer DOM element. YASMF always creates this for us, and it acts as the topmost element in the DOM hierarchy:

 var rootContainer = _y.ge("rootContainer"); var noteListView = new ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required