Thanks to visit codestin.com
Credit goes to github.com

Skip to content

comnicojs/baobab-angular

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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();
    });

  });

About

A state handling library for Angular, based on Baobab

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%