newApp.Collection error not defined

17 views
Skip to first unread message

Irina Trotsenko

unread,
Dec 11, 2013, 4:22:32 AM12/11/13
to themp...@googlegroups.com
At the very beginning in collections/contacts.js I got the error


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

Please help!

hano

unread,
Dec 11, 2013, 4:49:24 AM12/11/13
to themp...@googlegroups.com
Hi,
i'm a little bit confused. Which application did you work on?
I guess you work on a new absinthe app. I get this error if I init a view before initializing the model bound to it.
Try first to init collections and models and then the views.

Is the code hosted somewhere? Then I can have a look at it in detail.
cheers
marco
Reply all
Reply to author
Forward
0 new messages