src/module/directives/height/mat-height.directive.ts
Methods |
Inputs |
HostBindings |
matHeight
|
Type : |
matMaxHeight
|
Type : |
matMinHeight
|
Type : |
style.height |
style.height:
|
Type : string
|
style.max-height |
style.max-height:
|
Type : string
|
style.min-height |
style.min-height:
|
Type : string
|
ngOnChanges | ||||||
ngOnChanges(changes: SimpleChanges)
|
||||||
Parameters :
Returns :
void
|
ngOnInit |
ngOnInit()
|
Returns :
void
|
import {Directive, HostBinding, Input, OnChanges, OnInit, SimpleChanges} from '@angular/core';
@Directive({
selector: ''
+ '[matHeight],'
+ '[matMinHeight],'
+ '[matMaxHeight]',
})
export class MatHeightDirective implements OnInit, OnChanges {
@Input()
matHeight: string;
@Input()
matMinHeight: string;
@Input()
matMaxHeight: string;
@HostBinding('style.height')
height: string;
@HostBinding('style.min-height')
minHeight: string;
@HostBinding('style.max-height')
maxHeight: string;
ngOnInit(): void {
this.height = this.matHeight;
this.minHeight = this.matMinHeight;
this.maxHeight = this.matMaxHeight;
}
ngOnChanges(changes: SimpleChanges): void {
// console.log('ngOnChanges: ', changes);
// console.log('ngOnChanges: ', changes['matHeight']);
}
}