RemoteView2.Collections = RemoteView2.Collections || {};
Uncaught ReferenceError: RemoteView2 is not defined
(function () {
'use strict';
RemoteView2.Collections.ContactsCollection = M.Collection.extend({
model: RemoteView2.Models.ContactModel,
// the collection uses the localStorage of the browser through the M.LocalStorageStore
store: M.LocalStorageStore.create({})
});
})();
in controllers.menu.js
// initialze the data
initData: function () {
//create a model to store the first and the last name
this.newContact = RemoteView2.Models.ContactModel.create();
// create the contacts collections if it doesn't exist
if (!this.contacts) {
// create the collection with demo data
this.contacts = RemoteView2.Collections.ContactsCollection.create(this.getContacts());
Uncaught TypeError: cannot call method "create" undefined