Logging activities

We have created a nice system to log activities. Now, let's go ahead and use it within our components, to keep an audit of all of the activities happening within the context of projects.

First, let's use our activities service to log activities when project tasks get updated and created. Logging activities can be viewed as an application side effect, and we don't want to cause side effects within our pure UI components. Instead, the container components are the perfect places to perform these kinds of operations.

Let's open the container component for our task list on the path src/app/container/task-list-container/task-list-container.component.ts, and apply the following changes:

import {ActivitiesService} from '../../activities/activities.service'; ...

Get Mastering Angular Components now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.