cerebral-angular-immutable-store
A cerebral package for angular and immutable-store
Debugger
You can download the Chrome debugger here.
More info on Cerebral and video introduction
Cerebral main repo is located here and a video demonstration can be bound here.
Install
npm install cerebral-angular-immutable-store
or
bower install cerebral-angular-immutable-store
Get started
angular.module('app', ['cerebral'])
.config(function (cerebralProvider) {
cerebralProvider.setState({
list: ['foo']
});
cerebralProvider.setDefaultArgs({
foo: 'bar'
});
})
.directive ('myComponent', function () {
return {
controllerAs: 'myComponent',
scope: {},
templateUrl: 'myComponent.html',
controller: function ($scope, cerebral) {
cerebral.injectState($scope, {
list: ['list']
});
$scope.addItem = function () {
cerebral.signals.addItemClicked();
};
}
};
})
.run(function (cerebral) {
var addItem = function addItem (args, state) {
state.push('list', 'bar');
};
cerebral.signal('addItemClicked', addItem);
});
Try it out
- Clone repo
npm install
npm start
- Go to
localhost:8080