moviepilot/chaplin — Issue #8: I need help fetching and loading collection from restful api.
Author: crussi
Created: 2012-03-08 05:33:42+00:00
State: open

I'm trying to use Chaplin as a sample scaffold to model my application on. In your Facebook sample you use a service provider to get "likes" and "posts". But, when if I wanted to load an object from a restful api instead? In my current app, that I'm migrating over to using Chaplin's architecture, I have a backbone collection called Notes. By simply calling notes.fetch the collection automatically fetches a json list from my restful api. For some reason, I can't seem to figure out the steps to trigger the fetching of a collection using Chaplin's architecture. In the case of "likes" in the initialize method "@getLikes()" ... which in turn calls the service provider with a callback to @processLikes(). This is all good. But, when how would I go about utilizing the built in capability of a collection to fetch its list from a restful api? I'm writing my application using vs.net 2010 and my backend is the new MVC 4 webapi (that supports restful services).

I'm really loving the architecture of Chaplin. It is quite elegant.

Best regards,
Chris