A quick example of using FalcorJS with AngularJS v1.
Install dependencies from both npm and jspm
npm install
Start server
npm start
The key to making FalcorJS work with AngularJS is getting it slotted nicely into the digest loop so that changes are detected and shown on the view.
Since FalcorJS is making it's own async http calls without $http
, we need to let AngularJS know when a change may have occurred.
The usual tool for this job is $scope.$apply()
, but we have to be 100% sure that another $scope.$apply()
call isn't already in progress or it will thrown an error.
We could use $timeout()
to achieve the same thing, but it will always cause a new digest loop to occur, even if there's already one in progress.
A better alternative is to use $scope.$evalAsync()
which gives us the best of both worlds.
Since FalcorJS returns Observables, we simply call $scope.$evalAsync()
when subscribing to an Observable.
- FalcorJS Website
- Calling Functions: particularly important for operations like 'add()' and 'remove()'
- FalcorJS Router Demo
- FalcorJS Express Demo: Uses
falcor-router-demo
as the router. - BabelJS: Awesome ES2015 (ES6) transpiler
- Reactive Extensions (Rx)
- Observable Specifications