baobab-angular

0.1.0 • Public • Published

baobab-angular

A state handling library for Angular, based on Baobab

angular.module('app', ['baobab'])
  .tree('myTree', function () {
    return {
      todos: []
    };
  })
  .controller('MyCtrl', function ($scope, myTree) {
    
    $scope.todos = myTree.select('todos').get();
 
    $scope.addTodo = function () {
      myTree.todos.push('foo');
    };
  
    $scope.$listenTo(myTree.todos, function () {
      $scope.todos = myTree.select('todos').get();
    });
 
  });

Readme

Keywords

none

Package Sidebar

Install

npm i baobab-angular

Weekly Downloads

2

Version

0.1.0

License

MIT

Last publish

Collaborators

  • christianalfoni