Skip to content
tabs-slides.ts 437 B
Newer Older
wangqinghua's avatar
wangqinghua committed
import {Directive, ElementRef, HostListener, Input} from '@angular/core';

@Directive({
  selector: '[tabs-slides]' // Attribute selector
})
export class TabsSlidesDirective {
  @Input('tabs-slides') index:Number;

  screenWidth = window.screen.width;
  constructor(public el:ElementRef) {
      console.log(this.el)
      console.log(this.index)
  }

  @HostListener('click')
  click(){

    console.log('directive:'+this.index)
  }

}