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


TypeScript Renderer.attachComponentView方法代码示例

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


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

示例1: _createViewRecurse

 _createViewRecurse(view: viewModule.AppView) {
   var binders = view.proto.elementBinders;
   for (var binderIdx = 0; binderIdx < binders.length; binderIdx++) {
     var binder = binders[binderIdx];
     if (binder.hasStaticComponent()) {
       var childView = this._createPooledView(binder.nestedProtoView);
       this._renderer.attachComponentView(view.render, binderIdx, childView.render);
       this._utils.attachComponentView(view, binderIdx, childView);
     }
   }
 }
开发者ID:Salim-K,项目名称:angular,代码行数:11,代码来源:view_manager.ts

示例2: createDynamicComponentView

  createDynamicComponentView(hostLocation: ElementRef, componentProtoViewRef: ProtoViewRef,
                             componentBinding: Binding, injector: Injector): ViewRef {
    var componentProtoView = internalProtoView(componentProtoViewRef);
    var hostView = internalView(hostLocation.parentView);
    var boundElementIndex = hostLocation.boundElementIndex;
    var binder = hostView.proto.elementBinders[boundElementIndex];
    if (!binder.hasDynamicComponent()) {
      throw new BaseException(
          `There is no dynamic component directive at element ${boundElementIndex}`)
    }
    var componentView = this._createPooledView(componentProtoView);
    this._renderer.attachComponentView(hostView.render, boundElementIndex, componentView.render);
    this._utils.attachComponentView(hostView, boundElementIndex, componentView);
    this._utils.hydrateDynamicComponentInElementInjector(hostView, boundElementIndex,
                                                         componentBinding, injector);
    this._utils.hydrateComponentView(hostView, boundElementIndex);
    this._viewHydrateRecurse(componentView);

    return new ViewRef(componentView);
  }
开发者ID:B-Thapa,项目名称:angular,代码行数:20,代码来源:view_manager.ts


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