Putting it all together

We're almost there. We just need to add some styles, edit a couple of files with minor adjustments, and we'll be done!

Getting on with it

If you were to run the app now, it would work, but you wouldn't actually be able to create image notes, which defeats the purpose of what we've done so far. The reason the app fails is because we haven't updated our factories or our note list view.

In www/js/app/factories/noteFactory.js, we update the factory so that it can return an image note and an appropriate filename. Use the following code to update the factory:

define ( ["app/models/baseNote", "app/models/audioNote","app/models/imageNote"], function ( BaseNote, AudioNote, ImageNote ) { noteFactory.createNote = function ( noteType ) ...

Get PhoneGap 3.x Mobile Application Development HOTSHOT now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.