这是我的指示:
a = 0
//if it was 5m time frame a=1
//if it was 15m time frame a=2
//if it was 45m time frame a=3
//if it was 60 time frame a=4
a = is5mTimePeriod ? 1 : is15mTimeperiod ? 2 : .............
我的问题是:
import { Directive, HostListener, ElementRef, Renderer, Input } from '@angular/core';
@Directive({
selector: '[carouselDirective]'
})
export class CarouselDirective {
@Input() carouselDirective:any;
constructor( private el : ElementRef, private renderer: Renderer ) {
console.log(el.nativeElement); //how to add the click / hover events to it's childrens?
}
@HostListener('click') onClick() {
window.alert("onClick");
}
@HostListener('mouseover') onHover() {
window.alert("hover");
}
}