Skip to Main Content
Mastering Angular Components - Second Edition
book

Mastering Angular Components - Second Edition

by Gion Kunz
July 2018
Intermediate to advanced content levelIntermediate to advanced
402 pages
9h 35m
English
Packt Publishing
Content preview from Mastering Angular Components - Second Edition

Rendering activity indicators

We've already implemented the basics of the component and laid the groundwork for drawing time information into the coordinate system of our component. It's time to use our projection functions and draw our activities as indicators on the slider using SVG.

Let's open the template of our activity slider in src/app/activities/activity-slider/activity-slider.component.html, and add the following code:

<svg width="100%" height="70px">  <rect x="0" y="30" width="100%" height="40" class="slide"></rect>  <rect *ngFor="let activity of activities"        [attr.x]="projectTime(activity.time) + '%'"        height="40" width="2px" y="30" class="activity"></rect></svg>

Since we need to create an indicator for every activity within our activities ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning Angular, 2nd Edition

Learning Angular, 2nd Edition

Brad Dayley, Brendan Dayley, Caleb Dayley
Essential Angular

Essential Angular

Victor Savkin, Jeff Cross
Pro Angular 6

Pro Angular 6

Adam Freeman

Publisher Resources

ISBN: 9781788293532Supplemental Content