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

Implementing the note list view

Now that we've implemented the models, we can focus on the views. We'll start with the note list view, which should be defined in /www/js/app/views/noteListView.js. We'll also define three HTML snippets in /www/html/noteListView.html, /www/html/noteListView_android.html, and /www/html/noteListItem.html.

Getting ready

Before we do any of that, we need one additional piece of code: the note view factory. Just like we need a note factory to create notes of a specific type, we also need a note view factory to create the various editing views for each type of note. This is defined in www/js/app/factories/noteViewFactory.js, as follows:

define ( ["app/views/textNoteEditView", "app/factories/noteFactory"], function ( TextNoteEditView, ...

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