當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。