Check out example codes for "conditional (click) action angular". It will help you in understanding the concepts better.

Code Example 1

<button [class]="index===0? 'btn white': 'btn'" (click)="link && goToStories()">

Learn ReactJs, React Native from akashmittal.com