Video Course

Getting Started with Angular v2+: Lesson 13 of 26

Handling Click Events

Up Next

Showing Active Users

Autoplaying in 7 seconds!


To handle DOM events, we just need to wrap that event that we want to watch for with (). This is the event binding and we can watch for any events, even custom ones that we'll make ourselves in later lessons.

<div *ngIf="users">
    <ul class="list-group users-list">
    <li class="list-group-item"
        *ngFor="let user of users"
        []="user === activeUser">
            {{ }} ({{ user.username }})

Chris Sevilleja

162 posts

Co-founder of Slapping the keyboard until something good happens.