本文整理汇总了TypeScript中ember-utils.guidFor函数的典型用法代码示例。如果您正苦于以下问题:TypeScript guidFor函数的具体用法?TypeScript guidFor怎么用?TypeScript guidFor使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了guidFor函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: guidFor
}, ({ name, source, owner }) => {
let expandedName = source && this._resolveLocalLookupName(name, source, owner) || name;
let ownerGuid = guidFor(owner);
return ownerGuid + '|' + expandedName;
});
示例2: identity
function identity(item: any) {
switch (typeof item) {
case 'string':
case 'number':
return String(item);
default:
return guidFor(item);
}
}
示例3: constructor
constructor(mixins: Mixin[] | undefined, properties?: { [key: string]: any }) {
this.properties = properties;
this.mixins = buildMixinsArray(mixins);
this.ownerConstructor = undefined;
this._without = undefined;
if (DEBUG) {
this[NAME_KEY] = undefined;
/*
In debug builds, we seal mixins to help avoid performance pitfalls.
In IE11 there is a quirk that prevents sealed objects from being added
to a WeakMap. Unfortunately, the mixin system currently relies on
weak maps in `guidFor`, so we need to prime the guid cache weak map.
*/
guidFor(this);
Object.seal(this);
}
}
示例4: compile
compile(builder: any) {
builder.wrapLayout(this.template);
builder.tag.static('div');
builder.attrs.static('id', guidFor(this));
builder.attrs.static('class', 'ember-view');
}