UNPKG

@bespunky/angular-zen

Version:

The Angular tools you always wished were there.

32 lines (31 loc) 1.18 kB
import { TemplateRef, ViewContainerRef, ElementRef, OnInit } from '@angular/core'; import { UniversalService } from '../services/universal.service'; import * as i0 from "@angular/core"; /** * Provides the base functionality for platform directives to render elements only on certain platforms. * * @export * @abstract * @class PlatformDirective * @implements {OnInit} */ export declare abstract class PlatformDirective implements OnInit { private template; private viewContainer; protected universal: UniversalService; constructor(template: TemplateRef<ElementRef>, viewContainer: ViewContainerRef, universal: UniversalService); /** * Checks whether the element should be rendered on the current platform and renders it. */ ngOnInit(): void; /** * Checks whether the element should be rendered on the current platform. * * @protected * @abstract * @returns {boolean} */ protected abstract shouldRender(): boolean; static ɵfac: i0.ɵɵFactoryDeclaration<PlatformDirective, never>; static ɵdir: i0.ɵɵDirectiveDeclaration<PlatformDirective, never, never, {}, {}, never, never, false>; }