Skip to content

Instantly share code, notes, and snippets.

@rolaveric
Last active September 2, 2015 11:58
Show Gist options
  • Save rolaveric/7858a9ffe37436577cb7 to your computer and use it in GitHub Desktop.
Save rolaveric/7858a9ffe37436577cb7 to your computer and use it in GitHub Desktop.
A FalcorJS Model with a HttpDataSource loaded into an AngularJS controller
import angular from 'angular';
import falcor from 'falcor';
import HttpDataSource from 'falcor-http-datasource';
class MyController {
constructor() {
this.model = new falcor.Model({
source: new HttpDataSource('/model.json')
}).batch(); // Batches value requests together
}
}
angular.module('falcorExample', [])
.controller('MyController', MyController);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment