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 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 ) ...

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