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!
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 NoteListView ();
Tell it to attach itself to the rootContainer
element:
noteListView.init( rootContainer ); // store this for future reference APP.noteListView = noteListView; } return APP; });
Next, define www...