I have all the HTML , JS code here on codepen : http://cdpn.io/nbuGB

I started learning marionette JS. Somehow this simple example is not working.

It throws error : Uncaught TypeError: undefined is not a function

how to resolve this ?

有帮助吗?

解决方案

Your problem is in these lines:

ContactManager.reqres.setHandler("contact:entities",function(){
    return API.getContactEntities; 
});

You need to write API.getContactEntities() otherwise you're returning a function reference instead of your contacts collection. This causes the undefined error.

See: http://codepen.io/anon/pen/jALtq

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top