0.1.0 • Published 6 years ago

ng-horizontal-timeline v0.1.0

Weekly downloads
-
License
MIT
Repository
-
Last release
6 years ago

ng-horizontal-timeline

AngularJS component to help create a horizontal timeline with css animations.

Usage

  • Add it to your module
angular
  .module('myModule', ['ng-horizontal-timeline']) //import the component module
  .controller('myController', ['$log', function($log) {
    var vm = this;
    $log.debug('Hello world!');
    vm.events = [
      {
        text: 'test1'
      },
      {
        text: "test2"
      }
    ];
    
    vm.index = 2;
    
    vm.logClickEvent = function() {
      $log.debug('Event clicked: ', vm.events[vm.index]);
    };
    
    return vm;
  }]);
  • Add the component to your template
<!DOCTYPE html>
<html ng-app="myModule" ng-strict-di>
<body ng-controller="myController as vm">

<h-timeline events="vm.events" event-click="vm.logClickEvent()" selected-index="vm.index"></h-timeline>

</body>
</html>