File

src/components/weather-actions/actions.component.ts

Metadata

changeDetection ChangeDetectionStrategy.OnPush
selector weather-actions
styles button { border: none; background: transparent; cursor: pointer; font-size: 1.6em; border-radius: 50%; color: inherit; } button:hover { background: rgba(0,0,0, 0.1); }
template
<button (click)="update.emit()"><i class="wi wi-refresh"></i></button>

Outputs

update $event type: EventEmitter<any>
import {
  ChangeDetectionStrategy,
  Component,
  EventEmitter,
  Output
} from '@angular/core';

@Component({
  selector: 'weather-actions',
  changeDetection: ChangeDetectionStrategy.OnPush,
  styles: [
    `
    button {
      border: none;
      background: transparent;
      cursor: pointer;
      font-size: 1.6em;
      border-radius: 50%;
      color: inherit;
    }
    button:hover {
      background: rgba(0,0,0, 0.1);
    }
  `
  ],
  template: `
    <button (click)="update.emit()"><i class="wi wi-refresh"></i></button>
  `
})
export class WeatherActionsComponent {
  @Output() update: EventEmitter<any> = new EventEmitter();
}
Legend
Html element
Component
Html element with directive

results matching ""

    No results matching ""