cocori-ng
Version:
Cocori-ng is an Angular full of great components & utilites based on Material
26 lines (24 loc) • 1.35 kB
TypeScript
import { Type, ViewContainerRef } from '@angular/core';
import * as i0 from "@angular/core";
export interface InputsComponent {
[key: string]: any;
}
export interface OutputsComponent {
[key: string]: Function;
}
export declare class InjectComponentService {
componentsRefs: any[];
/**
* Exemple d'utilisation:
* this.injectComponentService.loadAndAddComponentToContainer(MyClasseComponent, #DomReference,
{ @InputName_1: Value, @InputName_2: Value }, { @OutputName_1: (valueEmited: any) => this.callback(valueEmited)})
* Ou si le composant n'a pas de @Output
* this.injectComponentService.loadAndAddComponentToContainer(MyClasseComponent, #DomReference,
{ @InputName_1: Value, @InputName_2: Value }, null)
*/
loadAndAddComponentToContainer(componentClass: Type<any>, viewContainerRef: ViewContainerRef, inputs: InputsComponent, outputs?: OutputsComponent, index?: number): void;
removeComponentFromViewContainer(index: number, viewContainerRef: ViewContainerRef): void;
moveComponentFromViewContainer(currentIndex: number, previousIndex: number, viewContainerRef: ViewContainerRef): void;
static ɵfac: i0.ɵɵFactoryDeclaration<InjectComponentService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<InjectComponentService>;
}