File

libs/time/src/lib/time-list-selector/time-list-selector.component.ts

Metadata

selector n52-time-list-selector
templateUrl ./time-list-selector.component.html

Index

Methods
Inputs
Outputs

Inputs

timeList
Type : number[]

Outputs

onTimeSelected
Type : EventEmitter<number>

Methods

Public selectTime
selectTime(timestamp: number)
Parameters :
Name Type Optional
timestamp number No
Returns : void
import { Component, EventEmitter, Input, Output } from '@angular/core';

@Component({
  selector: 'n52-time-list-selector',
  templateUrl: './time-list-selector.component.html'
})
export class TimeListSelectorComponent {

  @Input()
  public timeList: number[];

  @Output()
  public onTimeSelected: EventEmitter<number> = new EventEmitter();

  public selectTime(timestamp: number) {
    this.onTimeSelected.emit(timestamp);
  }

}
<div class="selector-entry" *ngFor="let time of timeList" (click)="selectTime(time)">
  <span>{{time | tzDate: 'L LT z'}}</span>
</div>
Legend
Html element
Component
Html element with directive

result-matching ""

    No results matching ""