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


TypeScript views.getViewId函数代码示例

本文整理汇总了TypeScript中@ember/-internals/views.getViewId函数的典型用法代码示例。如果您正苦于以下问题:TypeScript getViewId函数的具体用法?TypeScript getViewId怎么用?TypeScript getViewId使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: register

 register(view: any) {
   let id = getViewId(view);
   assert(
     'Attempted to register a view with an id already in use: ' + id,
     !this._viewRegistry[id]
   );
   this._viewRegistry[id] = view;
 }
开发者ID:habdelra,项目名称:ember.js,代码行数:8,代码来源:renderer.ts

示例2: constructor

  constructor(
    root: Component | OutletView,
    env: Environment,
    template: OwnedTemplate,
    self: VersionedPathReference<Opaque>,
    parentElement: Simple.Element,
    dynamicScope: DynamicScope,
    builder: IBuilder
  ) {
    assert(`You cannot render \`${self.value()}\` without a template.`, template !== undefined);

    this.id = getViewId(root);
    this.env = env;
    this.root = root;
    this.result = undefined;
    this.shouldReflush = false;
    this.destroyed = false;

    let options = (this.options = {
      alwaysRevalidate: false,
    });

    this.render = () => {
      let layout = template.asLayout();
      let handle = layout.compile();
      let iterator = renderMain(
        layout['compiler'].program,
        env,
        self,
        dynamicScope,
        builder(env, { element: parentElement, nextSibling: null }),
        handle
      );
      let iteratorResult: IteratorResult<RenderResult>;
      do {
        iteratorResult = iterator.next();
      } while (!iteratorResult.done);

      let result = (this.result = iteratorResult.value);

      // override .render function after initial render
      this.render = () => result.rerender(options);
    };
  }
开发者ID:habdelra,项目名称:ember.js,代码行数:44,代码来源:renderer.ts

示例3: unregister

 unregister(view: any) {
   delete this._viewRegistry[getViewId(view)];
 }
开发者ID:habdelra,项目名称:ember.js,代码行数:3,代码来源:renderer.ts


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