SetUp
npm install angular-timeline
Usage
import { TimelineModule } from 'angular-timeline'
In Html
<app-timeline [eventsSource]="timelineEvents" [eventsAlignment]="eventsAlignment">
Input Properties:
@Input() eventsSource : array of timeline events
@Input() eventsAlignment :'LEFT':'RIGHT','ALTERNATE'
Default alignment will be ALTERNATIVE.
In Ts
public timelineEvents: TimeLineEvent[];
public eventsAlignment: EventDirection; constructor() { this.timelineEvents = new Array();
}
ngOnInit(): void { this.eventsAlignment = EventDirection.ALTERNATE;
this.timelineEvents.push({
title: 'Freelancer', time: '2013 - present',
description: 'My current employment.Way better than the position before!'
});
this.timelineEvents.push({
title: 'Facebook', time: '2011 - 2013',
description: 'My second employment.Great work.'
});
this.timelineEvents.push({
title: 'Google', time: '2009 - 2011',
description: 'My first employer. All the stuff I\'ve learned and projects I\'ve been working on.'
});
}
Support
Please reach me for any issues/features/updates :kata.yaswanth@gmail.com