my-lib/grid/grid-item/grid-item.ts
changeDetection | ChangeDetectionStrategy.OnPush |
encapsulation | ViewEncapsulation.None |
selector | [gridItem],grid-item |
templateUrl | ./grid-item.html |
Properties |
Methods |
Inputs |
HostListeners |
Accessors |
constructor(ele: ElementRef, render: Renderer2)
|
||||||||||||
Defined in my-lib/grid/grid-item/grid-item.ts:28
|
||||||||||||
Parameters :
|
active
|
Type: |
Defined in my-lib/grid/grid-item/grid-item.ts:26
|
touchend |
Arguments : '$event'
|
touchend(e: )
|
Defined in my-lib/grid/grid-item/grid-item.ts:20
|
touchstart |
Arguments : '$event'
|
touchstart(e: )
|
Defined in my-lib/grid/grid-item/grid-item.ts:16
|
setActive | ||||||||
setActive(val: any)
|
||||||||
Defined in my-lib/grid/grid-item/grid-item.ts:37
|
||||||||
Parameters :
Returns :
void
|
_active |
_active:
|
Type : string
|
Defined in my-lib/grid/grid-item/grid-item.ts:24
|
active |
setactive(val: any)
|
Defined in my-lib/grid/grid-item/grid-item.ts:26
|
import {
ViewEncapsulation, Component, ElementRef,
Renderer2, ChangeDetectionStrategy, HostListener,
Input
} from '@angular/core';
import { Antd } from '../../antd';
import { FlexItemComponent, } from '../../flex/flex-item/flex-item';
@Component({
selector: '[gridItem],grid-item',
templateUrl: './grid-item.html',
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush
})
export class GridItemComponent extends FlexItemComponent {
@HostListener('touchstart', ['$event'])
touchstart(e) {
this.setActive(true);
}
@HostListener('touchend', ['$event'])
touchend(e) {
this.setActive(false);
}
_active: string;
@Input()
set active(val: any){
this._active = val ? val : 'am-grid-item-active'
}
constructor(
ele: ElementRef,
render: Renderer2
) {
super(ele, render);
this.addToClass('am-grid-item', true, false)
}
setActive(val: any) {
this.addToClass(this._active, this.isMeepoTrue(val), false);
}
}
<div class="am-grid-item-content">
<ng-content></ng-content>
</div>