本文整理汇总了TypeScript中ember-views.getViewId函数的典型用法代码示例。如果您正苦于以下问题:TypeScript getViewId函数的具体用法?TypeScript getViewId怎么用?TypeScript getViewId使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getViewId函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: constructor
constructor(
root: Opaque,
env: Environment,
template: OwnedTemplate,
self: VersionedPathReference<Opaque>,
parentElement: Simple.Element,
dynamicScope: DynamicScope) {
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 iterator = template.render(self, parentElement, dynamicScope);
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);
};
}
示例2: 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;
}
示例3: 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);
};
}
示例4: unregister
unregister(view: Opaque) {
delete this._viewRegistry[getViewId(view)];
}
示例5: unregister
unregister(view: any) {
delete this._viewRegistry[getViewId(view)];
}