-5

Is it possible to call two functions in one click in html?

Here is my code:

<div class="user-list"
 (click)="threadService.createChatWindow()"
 (click)="matrixService.newRoom(thread)">
</div>

It does not work

Floriane
  • 315
  • 6
  • 20
  • It would be better that a single click event calls a single method that, in turn, can decide what other related action(s) need to be taken. – Andy G Dec 14 '17 at 11:14

1 Answers1

1

You cannot have two attributes, instead combine with ;:

<div class="user-list"
 (click)="threadService.createChatWindow(); matrixService.newRoom(thread)">
</div>
Praveen Kumar Purushothaman
  • 164,888
  • 24
  • 203
  • 252