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


TypeScript DynamicComponentLoader.loadAsRoot方法代码示例

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


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

示例1: ngOnInit

	ngOnInit() {
		for(var i = 0; i < this.grid.length; i++) {
			var selector: string = '.tile-content-' + i;
			var tile = this.grid[i];
			this.loader.loadAsRoot(tile.component, selector, this.injector);	
		}
	}
开发者ID:samfcmc,项目名称:piframe,代码行数:7,代码来源:dashboard.component.ts

示例2: ngOnInit

 ngOnInit(){
   this._loader.loadAsRoot(this.steps[0].component, '#multistep-outline', this.injector);
   this.steps.forEach((obj, iter)=> {
     if(iter === 0) {
       this.stepStyles[iter] = 'doing';
     }
     else {
        this.stepStyles[iter] = 'todo';
     }
   });
   this.lastStepNumber = this.steps.length;
 }
开发者ID:kaadash,项目名称:ng2-multistep,代码行数:12,代码来源:multistep.component.ts

示例3: changeStep

 changeStep(stepNumber){
   if(stepNumber < this.lastStepNumber && stepNumber >= 0) {
     this._loader.loadAsRoot(this.steps[stepNumber].component, '#multistep-outline', this.injector);
     for (let i = stepNumber - 1; i >= 0; i--) {
       this.stepStyles[i] = 'done';
     }
     this.stepStyles[stepNumber] = 'doing';
     for (let i = stepNumber + 1; i < this.lastStepNumber; i++) {
       this.stepStyles[i] = 'todo'; 
     }
     this.currentStep = stepNumber;
   }
 }
开发者ID:kaadash,项目名称:ng2-multistep,代码行数:13,代码来源:multistep.component.ts

示例4: createPopover

  createPopover(componentType: Type, params: Object = {}): Promise<ComponentRef<any>> {
    const id = this._createBackDrop();
    const dispose = () => {
      const backdrop: any = document.querySelector('#' + id);
      if (backdrop.childen[0] && backdrop.children[0].dismiss instanceof Function) {
        backdrop.children[0].dismiss();
      }
      backdrop.remove();
    };

    return this._dcl.loadAsRoot(componentType, '#' + id, this._injector, dispose)
      .then(componentRef => {
        return new Promise(resolve => {
          setImmediate(() => {
            componentRef.location.nativeElement.children[0].show('ons-button'); // TODO: fix
            resolve(componentRef);
          });
        });
      });
  }
开发者ID:DavyDuDu,项目名称:OnsenUI,代码行数:20,代码来源:createPopover.ts

示例5: loadComponent

 loadComponent() {
   this.dcl.loadAsRoot(DynamicComponent, '#anchor', this.injector)
     .then(componentRef => console.log('loadAsRoot', componentRef));
 }
开发者ID:Xiahl1990,项目名称:augury,代码行数:4,代码来源:load-as-root-component.ts

示例6: displayLoginForm

 displayLoginForm(){
   console.log("displaying login form")
   this.setForm = 'Login Here'
   this.component = this.dcl.loadAsRoot(LoginForm, '#form', this._inject);
     }
开发者ID:drews256,项目名称:Ionic2Angular2,代码行数:5,代码来源:user.ts

示例7: displaySignUpForm

 displaySignUpForm(){
   console.log("displaying signup form")
   this.setForm = 'Sign Up Here'
   this.component = this.dcl.loadAsRoot(SignUpForm, '#form', this._inject);
     }
开发者ID:drews256,项目名称:Ionic2Angular2,代码行数:5,代码来源:user.ts

示例8: constructor

    constructor(private loader: DynamicComponentLoader, 
                private injector: Injector) {
                    
                    loader.loadAsRoot(ChildComponent, '#child', injector);

                }
开发者ID:edmulraney,项目名称:sam-samples,代码行数:6,代码来源:app.component.ts

示例9: ngOnInit

	ngOnInit(){

		this.dcl.loadAsRoot(WidgetComponent2, '#child', this.injector);
	}
开发者ID:debasispanda,项目名称:angular2-webpack,代码行数:4,代码来源:app.component.ts


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