The Mega App model and API

The Mega App model contains only one JavaScript object that represents the voice and photo memo data, as shown in the following code snippet:

var MemoItem = function(memoItem) {
    this.id = memoItem.id || "Memo_" + (new Date()).getTime();
    this.title = memoItem.title || "";
    this.desc = memoItem.desc || "";
    this.type = memoItem.type || "voice";
    this.location = memoItem.location || "";
    this.mtime = memoItem.mtime || "";
};

The MemoItem object contains the following attributes:

  • id: This represents the memo ID (its default value is unique as it includes a numeric value of the current time in milliseconds)
  • title: This represents the memo title
  • desc: This represents the memo description
  • type: This represents the memo type, and it can ...

Get JavaScript Mobile Application Development now with O’Reilly online learning.

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