Skip to content

Instantly share code, notes, and snippets.

@rajaramtt
Last active May 3, 2020 09:44
Show Gist options
  • Save rajaramtt/f0fed4efafc68cdce6539317b1fa6903 to your computer and use it in GitHub Desktop.
Save rajaramtt/f0fed4efafc68cdce6539317b1fa6903 to your computer and use it in GitHub Desktop.
Property
<img [src]="heroImageUrl">
<app-hero-detail [hero]="currentHero"></app-hero-detail>
<div [ngClass]="{'special': isSpecial}"></div>
Event
<button (click)="onSave()">Save</button>
<app-hero-detail (deleteRequest)="deleteHero()"></app-hero-detail>
<div (myClick)="clicked=$event" clickable>click me</div>
Two-way
<input [(ngModel)]="name">
Attribute
<button [attr.aria-label]="help">help</button>
Class
<div [class.special]="isSpecial">Special</div>
Style
<button [style.color]="isSpecial ? 'red' : 'green'">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment