File

core/src/utils/on-init.directive.ts

Description

A utility directive used internally in InputComponent to fire code in a template-driven way during the OnInit lifecycle.

Implements

OnInit

Metadata

Selector [teOnInit]

Index

Methods
Inputs

Constructor

constructor(el: ElementRef)
Parameters :
Name Type Optional
el ElementRef<HTMLElement> No

Inputs

teOnInit

Type : any

Methods

ngOnInit
ngOnInit()
Returns : void
import { Directive, Input, OnInit, ElementRef } from '@angular/core';

/**
 * A utility directive used internally in [InputComponent]{@link InputComponent} to fire code in a template-driven way during the OnInit lifecycle.
 */
@Directive({ selector: '[teOnInit]' })
export class OnInitDirective implements OnInit {
	@Input('teOnInit') public teOnInit: any;
	constructor(private el: ElementRef<HTMLElement>) {}
	ngOnInit(): void {
		this.teOnInit(this.el);
	}
}

result-matching ""

    No results matching ""