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 Base Note data model

Now that we've got the model designed, it's time to implement it in code. This particular model will need to go in /www/js/app/models/baseNote.js.

Getting ready

Here's the code for the base note model. We've stripped a lot of the preamble and the comments as they appear in the code. In place of the stripped comments, we've added more in-depth commentary where necessary.

Let's start with the shell of the module. We do this by starting with define. This indicates to RequireJS that we're defining a module. The name of the module is inferred from the filename. We indicate that we'll need YASMF as a dependency. We also create a subclass of YASMF's BaseObject class. Note that we use _className here. YASMF objects maintain ...

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