当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript DynamicComponentLoader.loadIntoLocation方法代码示例

本文整理汇总了TypeScript中angular2/core.DynamicComponentLoader.loadIntoLocation方法的典型用法代码示例。如果您正苦于以下问题:TypeScript DynamicComponentLoader.loadIntoLocation方法的具体用法?TypeScript DynamicComponentLoader.loadIntoLocation怎么用?TypeScript DynamicComponentLoader.loadIntoLocation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在angular2/core.DynamicComponentLoader的用法示例。


在下文中一共展示了DynamicComponentLoader.loadIntoLocation方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: ngOnInit

 ngOnInit() {
   this.dcl.loadIntoLocation(this.type, this.element, 'ngTableCustom')
   .then((component) => {
       if (component.instance.ngTableOnInit) {
           component.instance.ngTableOnInit(this.index, this.row);
       }
   });
 }
开发者ID:dalvarado909,项目名称:ng2-table,代码行数:8,代码来源:ng-table-custom.component.ts

示例2:

 .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;
         });
 });
开发者ID:dineyw23,项目名称:BossyUI,代码行数:8,代码来源:app.component.ts

示例3: CreateDynamicAlert

 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);              
        }); 
 }  
开发者ID:CarlosLanderas,项目名称:ng2-dynamicComponentLoader-demo,代码行数:9,代码来源:app.component.ts

示例4: ngOnInit

  ngOnInit() {
    const someDynamicHtml = `<p-o-c></p-o-c><h6>${Date.now()}</h6>`;

    this.loader.loadIntoLocation(
      compileToComponent(someDynamicHtml, [ProofOfConceptComponent]),
      this.elementRef,
      'container'
    );
  }    
开发者ID:GoodSoil,项目名称:Ang2CourseNotes,代码行数:9,代码来源:dynamic-content.component.ts

示例5: initializeWidget

 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();
     });
 }
开发者ID:thombergs,项目名称:infiniboard,代码行数:10,代码来源:dashboard.component.ts

示例6: ngOnInit

   ngOnInit() {
      var data = `<ul><li><a [routerLink]="['/Welcome']">Index</a></li><li><a [routerLink]="['/Page1']">Page1</a></li><li><a [routerLink]="['/Page2']">Page2</a></li><li><a [routerLink]="['/Page3']">Page3</a></li></ul>`
      this._loader.loadIntoLocation(this.compileToComponent(data, ROUTER_DIRECTIVES),
              this._elementRef,
              'menulink');
  //  this._dataServices.GetMenuLinks().subscribe(data => 
  //                    this._loader.loadIntoLocation(this.compileToComponent(data, ROUTER_DIRECTIVES), 
   //                                                 this._elementRef, 
 //                                                   'menulink'
 //                                                   )
 //                                               );
   
  }
开发者ID:mgpeng,项目名称:DynamicalAsyncRouter,代码行数:13,代码来源:MyRouterLink.ts

示例7: bind

    public bind(Component, modalComponentRef, providers) {
		let elementRef: ElementRef = modalComponentRef.location;
		
		// providers = providers || [];		
		// providers.push( Injector.resolve([ provide(ModalComponent, {useValue: modalComponentRef.instance}) ]) );

		let promise = this._componentLoader.loadIntoLocation(Component, elementRef, 'comp', providers).then( componentRef => {
			componentRef.instance._modalComponent = modalComponentRef.instance;
			modalComponentRef.instance.loaded = true;
			
			return componentRef;
		});
		
		return promise;
    }
开发者ID:jalasem,项目名称:osliknet,代码行数:15,代码来源:modal.service.ts

示例8: addQuestion

    public addQuestion(): void {
        this._dcl.loadIntoLocation(NewQuestionComponent, this._elementRef, 'newQuestion')
        .then(ref => {
            this._childRef.push({id: this._nextId, ref: ref});

            ref.instance.number = this._nextId;

            ref.instance.destroy.subscribe($event => {
                this.removeQuestion($event);
            });

            ref.instance.questionChange.subscribe($event => {
                this.onQuestionChange($event);
            });

             this._nextId++;
        });
    }
开发者ID:ThomasCedrini,项目名称:english_learning,代码行数:18,代码来源:editor.component.ts

示例9: elementClicked

    elementClicked(e){

        if(!e.vertex){
            return;
        }

        if(this.first === null){
            this.first = e.coordinates;
        }
        else if(this.second === null){
            this.second = e.coordinates;
            this.dynamicComponentLoader.loadIntoLocation(Edge, this.elementRef, this.first.dynamicLocation)
                .then((res) => {
                    res.instance.setCoordinates(this.first.x, this.first.y, this.second.x, this.second.y);
                    this.first = null;
                    this.second = null;
            });
        }
    }
开发者ID:2947721120,项目名称:angular-2-samples,代码行数:19,代码来源:graph.ts

示例10:

 .then(m => {
   loader.loadIntoLocation(provider.provide(m), el, 'content');
 });
开发者ID:effyma,项目名称:angular2-cms,代码行数:3,代码来源:ComponentProxyFactory.ts


注:本文中的angular2/core.DynamicComponentLoader.loadIntoLocation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。