/** Core */ import { Generic, HostElementComponent } from "cmf.core/src/core"; /** Angular2 */ import * as ng from "@angular/core"; /** * Interface to be implemented by the host */ export interface DeferInstantiationHost { deferInstantiationExpression: string; } /** * This directive should be used with templates to create embedded views. Its main purpose is to instantiate all components within a template when a given condition is true. * This condition is passed to the directive as a property. It has one default condition that matches the condition required by wizards which was the first use case for the directive. * The directive looks for its injector's parent so it finds a parent component. The condition is then evaluated against the parent component at runtime. If the evaluation is true, then the child * content is instantiated. This allows deferring calling service to when they are really need, without having to process too early in the flow. * * ## Example * * Assume this HTML Template * * ```html * * * * * * * ``` * * As we can see we apply the directive to a template which means that the directive will evaluate the "isVisited" string against the wizard step component. This allows not having to define * local variables for each step because its assumes that the directive will look for a parent component. When the WizardStep.isVisited property is true, then the cmf-wizard-step1 component or * any other component(s) inside the template will be instantiated. */ export declare class DeferInstantiation extends Generic { private viewContainerRef; private templateRef; /** * The default un-normalized expression to evaluate against the parent component. Since its a simple string that should be bound to the parent component, * it has no reference to the parent yet. * * @property {string} Un-normalized expression */ private unNormalizedExpression; /** * Will hold the normalized version of the unNormalizedExpression property where the parent component is injected into the string so it can be properly evaluated. * * @property {string} Normalized expression */ private normalizedExpression; /** * Observable listener */ private observeCallback; constructor(viewContainerRef: ng.ViewContainerRef, templateRef: ng.TemplateRef, hostElementComponent: HostElementComponent); /** * Evaluates the expression against the parent. */ private evaluateExpression; /** * When the directive client needs to pass its own expression to evaluate */ condition: any; } export declare class DeferInstantiationModule { }