File

src/module/directives/height/mat-height.directive.ts

Implements

OnInit OnChanges

Metadata

Index

Methods
Inputs
HostBindings

Inputs

matHeight

Type : string

matMaxHeight

Type : string

matMinHeight

Type : string

HostBindings

style.height
style.height: string
Type : string
style.max-height
style.max-height: string
Type : string
style.min-height
style.min-height: string
Type : string

Methods

ngOnChanges
ngOnChanges(changes: SimpleChanges)
Parameters :
Name Type Optional
changes SimpleChanges No
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']);
  }

}

result-matching ""

    No results matching ""