Flux implementation in Angular 1, used in production at Rise
demos/simple-todo/index.html & demos/simple-todo/todo-app.js for to
see it in action.
angular-flux.js contains the pieces that you need to get going with
the Flux architecture in Angular. Just download it and include it in
your app with the module ngFlux. Install it through bower with
bower install angular-flux-helpers --save.
- FluxUtilpackages a couple of functions to reduce boilerplate
- FluxUtil.defineConstantsdefines constants for you.
- FluxUtil.createDispatchercreates a dispatcher from Facebook's- dispatcher.jsprototype and adds a- handleViewActionfunction to it.
- FluxUtil.createStorecreates an object based the node.js- EventEmitterprototype, with a few useful helpers tacked on, such as- bindState(scope, callback)that will add a change listener to the store and execute the callback on change - it also safely removes this listener when the scope is destroyed.
- The localize-statedirective creates a one way data binding, so changes propagate down but not up, allowing you to keep the data in sync with wider application changes while controlling when the local state triggers an action. This directive is not needed to propagate changes, normal angular data-binding works better.
todo-app.js and it will make sense if you're already familiar with the Flux architecture.
Flix is an Android app (based on the Ionic Framework) that uses angular-flux. See /frontend/www/js/
- Implement the flux-chat example app