src/components/weather-icon/weather-icon.component.ts
changeDetection | ChangeDetectionStrategy.OnPush |
selector | weather-icon |
styles | { } |
template |
|
iconClass
|
Type: |
iconImageUrl
|
Type: |
title
|
Type: |
import {
Component,
ChangeDetectionStrategy,
Input,
Output,
EventEmitter
} from '@angular/core';
@Component({
selector: 'weather-icon',
changeDetection: ChangeDetectionStrategy.OnPush,
styles: [``],
template: `
<i *ngIf="iconClass" [class]="iconClass"></i>
<img *ngIf="iconImageUrl && !iconClass" [src]="iconImageUrl">
`
})
export class WeatherIconComponent {
@Input() iconClass: string;
@Input() iconImageUrl: string;
@Input() title: string;
}