ngAfterViewInit() {
     this.componentLoader.loadNextToLocation(
         this.dialogInstance.componentType, this._viewRef, this.dialogInstance.modalDataBindings)
         .then((contentRef: ComponentRef) => {
             this.dialogInstance.contentRef = contentRef;
         });
 }
 ngAfterViewInit() {
     this._dlc
         .loadNextToLocation(this._compileConfig.component,
             this._viewContainer,
             this._compileConfig.bindings)
         .then(contentRef => this.dialog.contentRef = contentRef);
 }
Example #3
0
 .then(componentModule => {
     this.dynamicComponentLoader.loadIntoLocation(componentModule[component.fullName], this.elementRef, 'content')
         .then(component => {
             //component.instance.inputProperty = this.config.Calendar;
             //component.instance.inputValue = this.config.Calendar;
             component.instance.config = this.config;
         });
 });
Example #4
0
 this.edgeService.getCoordinates().subscribe(coordinates => {
     this.dynamicComponentLoader
         .loadNextToLocation(Edge,coordinates.first.viewContainer)
         .then((res) => {
           res.instance.setCoordinates(coordinates.first, coordinates.second);
         })
         .catch(e => console.log(e));
 });
 ngOnInit() {
   this.dcl.loadIntoLocation(this.type, this.element, 'ngTableCustom')
   .then((component) => {
       if (component.instance.ngTableOnInit) {
           component.instance.ngTableOnInit(this.index, this.row);
       }
   });
 }
 private CreateDynamicAlert(alertBindings) {
      this.dynamicComponentLoader
        .loadIntoLocation(AlertComponent,this.element,'alertAppend', alertBindings)
        .then( comp => { 
            //We assign the componentRef to the instance
            comp.instance.contentRef(comp);
            console.log("Alert rendered with message: " + comp.instance.MessageContent);              
        }); 
 }  
  ngOnInit() {
    const someDynamicHtml = `<p-o-c></p-o-c><h6>${Date.now()}</h6>`;

    this.loader.loadIntoLocation(
      compileToComponent(someDynamicHtml, [ProofOfConceptComponent]),
      this.elementRef,
      'container'
    );
  }    
 private initializeWidget(widgetConfig: WidgetConfig) {
   let widgetComponent = this.getWidgetComponentByType(widgetConfig.type);
   let promise = this.dynamicComponentLoader.loadIntoLocation(widgetComponent, this.elementRef, 'widgets');
   Promise.resolve(promise).then(
     component => {
       component.instance.setUpdateInterval(1000);
       component.instance.initWidget(widgetConfig.id, widgetConfig.title);
       component.instance.updateWidgetData();
     });
 }
Example #9
0
  /** Attach the given ComponentPortal to DOM element using the DynamicComponentLoader. */
  attachComponentPortal(portal: ComponentPortal): Promise<ComponentRef> {
    if (portal.origin == null) {
      throw new MdComponentPortalAttachedToDomWithoutOriginException();
    }

    return this._componentLoader.loadNextToLocation(portal.component, portal.origin).then(ref => {
      this._hostDomElement.appendChild(ref.hostView.rootNodes[0]);
      this.setDisposeFn(() => ref.dispose());
      return ref;
    });
  }
Example #10
0
 return this.disposeDynCmp().then(() => {
   let component = this.popup.component;
   this.cmpRef = this.dcl.loadNextToLocation(component, this.dynCmp)
     .then(cmp => {
       if (this.popup.componentOptions) {
         cmp.instance.popupOptions = this.popup.componentOptions;
       }
       cmp.instance.popup = this.popup;
       return cmp;
     });
   this.visible = true;
 });