• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript api.Renderer类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1:

 _createPooledView(protoView: viewModule.AppProtoView): viewModule.AppView {
   var view = this._viewPool.getView(protoView);
   if (isBlank(view)) {
     view = this._utils.createView(protoView, this._renderer.createView(protoView.render), this,
                                   this._renderer);
     this._renderer.setEventDispatcher(view.render, view);
     this._createViewRecurse(view);
   }
   return view;
 }
开发者ID:188799958,项目名称:angular,代码行数:10,代码来源:view_manager.ts


示例2: _createViewHelper

 private _createViewHelper(args: List<any>, method) {
   var hostProtoView = this._serializer.deserialize(args[0], RenderProtoViewRef);
   var fragmentCount = args[1];
   var startIndex, renderViewWithFragments;
   if (method == "createView") {
     startIndex = args[2];
     renderViewWithFragments = this._renderer.createView(hostProtoView, fragmentCount);
   } else {
     var selector = args[2];
     startIndex = args[3];
     renderViewWithFragments =
         this._renderer.createRootHostView(hostProtoView, fragmentCount, selector);
   }
   this._renderViewWithFragmentsStore.store(renderViewWithFragments, startIndex);
 }
开发者ID:goderbauer,项目名称:angular,代码行数:15,代码来源:impl.ts


示例3: ViewRef

  createRootHostView(hostProtoViewRef: ProtoViewRef, overrideSelector: string,
                     injector: Injector): ViewRef {
    var hostProtoView = internalProtoView(hostProtoViewRef);
    var hostElementSelector = overrideSelector;
    if (isBlank(hostElementSelector)) {
      hostElementSelector = hostProtoView.elementBinders[0].componentDirective.metadata.selector;
    }
    var renderView = this._renderer.createRootHostView(hostProtoView.render, hostElementSelector);
    var hostView = this._utils.createView(hostProtoView, renderView, this, this._renderer);
    this._renderer.setEventDispatcher(hostView.render, hostView);
    this._createViewRecurse(hostView);

    this._utils.hydrateRootHostView(hostView, injector);
    this._viewHydrateRecurse(hostView);
    return new ViewRef(hostView);
  }
开发者ID:188799958,项目名称:angular,代码行数:16,代码来源:view_manager.ts


示例4:

  _viewDehydrateRecurse(view: viewModule.AppView, forceDestroyComponents) {
    this._utils.dehydrateView(view);
    this._renderer.dehydrateView(view.render);
    var binders = view.proto.elementBinders;
    for (var i = 0; i < binders.length; i++) {
      var componentView = view.componentChildViews[i];
      if (isPresent(componentView)) {
        if (binders[i].hasDynamicComponent() || forceDestroyComponents) {
          this._destroyComponentView(view, i, componentView);
        } else {
          this._viewDehydrateRecurse(componentView, false);
        }
      }
      var vc = view.viewContainers[i];
      if (isPresent(vc)) {
        for (var j = vc.views.length - 1; j >= 0; j--) {
          this._destroyViewInContainer(view, i, j);
        }
        for (var j = vc.freeViews.length - 1; j >= 0; j--) {
          this._destroyFreeEmbeddedView(view, i, j);
        }
      }
    }

    // freeHostViews
    for (var i = view.freeHostViews.length - 1; i >= 0; i--) {
      var hostView = view.freeHostViews[i];
      this._destroyFreeHostView(view, hostView);
    }
  }
开发者ID:B-Thapa,项目名称:angular,代码行数:30,代码来源:view_manager.ts


示例5: insert

 insert(view, atIndex=-1): viewModule.AppView {
   if (atIndex == -1) atIndex = this._views.length;
   this._insertInjectors(view, atIndex);
   this.parentView.changeDetector.addChild(view.changeDetector);
   this.renderer.insertViewIntoContainer(this.render, atIndex, view.render);
   return view;
 }
开发者ID:guoxiangfang,项目名称:angular,代码行数:7,代码来源:view_container.ts


示例6: detach

 /**
  * The method can be used together with insert to implement a view move, i.e.
  * moving the dom nodes while the directives in the view stay intact.
  */
 detach(atIndex=-1): viewModule.AppView {
   if (atIndex == -1) atIndex = this._views.length - 1;
   var detachedView = this._detachInjectors(atIndex);
   detachedView.changeDetector.remove();
   this.renderer.detachViewFromContainer(this.render, atIndex);
   return detachedView;
 }
开发者ID:guoxiangfang,项目名称:angular,代码行数:11,代码来源:view_container.ts


示例7:

 _destroyPooledView(view: viewModule.AppView) {
   var wasReturned = this._viewPool.returnView(view);
   if (!wasReturned) {
     this._renderer.destroyView(view.render);
     this._viewListener.viewDestroyed(view);
   }
 }
开发者ID:Salim-K,项目名称:angular,代码行数:7,代码来源:view_manager.ts


示例8:

 _destroyComponentView(hostView, boundElementIndex, componentView) {
   this._viewDehydrateRecurse(componentView, false);
   this._renderer.detachComponentView(hostView.elementRefs[boundElementIndex],
                                      componentView.render);
   this._utils.detachComponentView(hostView, boundElementIndex);
   this._destroyPooledView(componentView);
 }
开发者ID:cedriclam,项目名称:angular,代码行数:7,代码来源:view_manager.ts


示例9: viewCreated

 viewCreated(view: AppView) {
   var viewId = _nextId++;
   _allViewsById.set(viewId, view);
   _allIdsByView.set(view, viewId);
   for (var i = 0; i < view.elementRefs.length; i++) {
     _setElementId(this._renderer.getNativeElementSync(view.elementRefs[i]), [viewId, i]);
   }
 }
开发者ID:cedriclam,项目名称:angular,代码行数:8,代码来源:debug_element_view_listener.ts


示例10: detachViewInContainer

 detachViewInContainer(viewContainerLocation: ElementRef, atIndex: number): ViewRef {
   var parentView = internalView(viewContainerLocation.parentView);
   var boundElementIndex = viewContainerLocation.boundElementIndex;
   var viewContainer = parentView.viewContainers[boundElementIndex];
   var view = viewContainer.views[atIndex];
   this._utils.detachViewInContainer(parentView, boundElementIndex, atIndex);
   this._renderer.detachViewInContainer(viewContainerLocation, atIndex, view.render);
   return view.ref;
 }
开发者ID:cedriclam,项目名称:angular,代码行数:9,代码来源:view_manager.ts



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript compile_control.CompileControl类代码示例发布时间:2022-05-25
下一篇:
TypeScript api.RenderDirectiveMetadata类代码示例发布时间:2022-05-25
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap