UNPKG

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.

43 lines (42 loc) 1.74 kB
import { HookIndex } from '../../interfacesPublic'; import { HookParser } from '../../interfacesPublic'; import { AutoPlatformService } from '../platform/autoPlatformService'; import { ParseOptions } from '../settings/options'; import { Logger } from '../utils/logger'; import * as i0 from "@angular/core"; /** * Stores a hook element along with the parser who found it */ export interface ParserFindHookElementsResult { parser: HookParser; hookElement: any; } /** * The service responsible for finding element hooks in the content and marking them with anchor attrs */ export declare class ElementHookFinder { private platformService; private logger; constructor(platformService: AutoPlatformService, logger: Logger); /** * Finds all element hooks in an element and marks the corresponding anchor elements * * @param contentElement - The content element to parse * @param context - The current context object * @param parsers - The parsers to use * @param token - The current parse token * @param options - The current ParseOptions * @param hookIndex - The hookIndex object to fill */ find(contentElement: any, context: any, parsers: HookParser[], token: string, options: ParseOptions, hookIndex: HookIndex): HookIndex; /** * Checks the combined parserResults and validates them. Invalid ones are removed. * * @param parserResults - The parserResults to check * @param contentElement - The content element * @param options - The current ParseOptions */ private validateHookElements; static ɵfac: i0.ɵɵFactoryDeclaration<ElementHookFinder, never>; static ɵprov: i0.ɵɵInjectableDeclaration<ElementHookFinder>; }