ngx-dynamic-hooks
Version:
Automatically insert live Angular components into a dynamic string of content (based on their selector or any pattern of your choice) and render the result in the DOM.
57 lines (56 loc) • 2.94 kB
TypeScript
import { AfterViewInit, OnDestroy, OnChanges, ElementRef, DoCheck, AfterViewChecked, EventEmitter, Injector, SimpleChanges, EnvironmentInjector } from '@angular/core';
import { HookIndex } from '../interfacesPublic';
import { HookParser, LoadedComponent } from '../interfacesPublic';
import { DynamicHooksService } from '../services/dynamicHooksService';
import { HookParserEntry } from '../services/settings/parserEntry';
import { ComponentUpdater } from '../services/core/componentUpdater';
import { AutoPlatformService } from '../services/platform/autoPlatformService';
import { ParseOptions } from '../../public-api';
import * as i0 from "@angular/core";
/**
* The main component of the ngx-dynamic-hooks library to dynamically load components into content
*/
export declare class DynamicHooksComponent implements DoCheck, OnChanges, AfterViewInit, AfterViewChecked, OnDestroy {
private hostElement;
private dynamicHooksService;
private componentUpdater;
private platformService;
private environmentInjector;
private injector;
content: any;
context: any;
globalParsersBlacklist: string[] | null;
globalParsersWhitelist: string[] | null;
parsers: HookParserEntry[] | null;
options: ParseOptions | null;
componentsLoaded: EventEmitter<LoadedComponent[]>;
hookIndex: HookIndex;
activeOptions: ParseOptions;
activeParsers: HookParser[];
token: string;
initialized: boolean;
constructor(hostElement: ElementRef, dynamicHooksService: DynamicHooksService, componentUpdater: ComponentUpdater, platformService: AutoPlatformService, environmentInjector: EnvironmentInjector, injector: Injector);
ngDoCheck(): void;
ngOnChanges(changes: SimpleChanges): void;
ngAfterViewInit(): void;
ngAfterViewChecked(): void;
ngOnDestroy(): void;
/**
* Empties the state of this component
*/
reset(): void;
/**
* Parses the content and load components
*
* @param content - The content to parse
*/
parse(content: any): void;
/**
* Updates the bindings for all existing components
*
* @param triggerOnDynamicChanges - Whether to trigger the OnDynamicChanges method of dynamically loaded components
*/
refresh(triggerOnDynamicChanges: boolean): void;
static ɵfac: i0.ɵɵFactoryDeclaration<DynamicHooksComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<DynamicHooksComponent, "ngx-dynamic-hooks", never, { "content": { "alias": "content"; "required": false; }; "context": { "alias": "context"; "required": false; }; "globalParsersBlacklist": { "alias": "globalParsersBlacklist"; "required": false; }; "globalParsersWhitelist": { "alias": "globalParsersWhitelist"; "required": false; }; "parsers": { "alias": "parsers"; "required": false; }; "options": { "alias": "options"; "required": false; }; }, { "componentsLoaded": "componentsLoaded"; }, never, never, true, never>;
}