Getting Started with Angular: 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.

Table of Contents

    <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

    176 posts

    Founder of Google Developer Expert in Web Technologies. Slapping the keyboard until something good happens.