本文整理汇总了TypeScript中@angular/core/src/view/index.textDef函数的典型用法代码示例。如果您正苦于以下问题:TypeScript textDef函数的具体用法?TypeScript textDef怎么用?TypeScript textDef使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了textDef函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: it
it('should create views with multiple root ng-content nodes', () => {
const {view, rootNodes} = createAndGetRootNodes(compViewDef(hostElDef(
[textDef(0, ['a']), textDef(1, ['b'])], [ngContentDef(null, 0), ngContentDef(null, 1)])));
expect(getDOM().childNodes(rootNodes[0])[0]).toBe(asTextData(view, 2).renderText);
expect(getDOM().childNodes(rootNodes[0])[1]).toBe(asTextData(view, 3).renderText);
});
开发者ID:rlugojr,项目名称:angular,代码行数:7,代码来源:ng_content_spec.ts
示例2: it
it('should create views with multiple root text nodes', () => {
const rootNodes = createAndGetRootNodes(compViewDef([
textDef(0, null, ['a']),
textDef(1, null, ['b']),
])).rootNodes;
expect(rootNodes.length).toBe(2);
});
开发者ID:Cammisuli,项目名称:angular,代码行数:7,代码来源:text_spec.ts
示例3: it
it('should reverse child order for root nodes', () => {
const vd = viewDef(ViewFlags.None, [
textDef(null, ['a']), // level 0, index 0
textDef(null, ['a']), // level 0, index 0
]);
expect(reverseChildOrder(vd)).toEqual([1, 0]);
});
开发者ID:manekinekko,项目名称:angular,代码行数:8,代码来源:view_def_spec.ts
示例4: it
it('should calculate parents for one level', () => {
const vd = viewDef(ViewFlags.None, [
elementDef(NodeFlags.None, null, null, 2, 'span'),
textDef(null, ['a']),
textDef(null, ['a']),
]);
expect(parents(vd)).toEqual([null, 0, 0]);
});
开发者ID:JohnnyQQQQ,项目名称:angular,代码行数:9,代码来源:view_def_spec.ts
示例5: it
it('should calculate parents for one level, multiple roots', () => {
const vd = viewDef(ViewFlags.None, [
elementDef(NodeFlags.None, 1, 'span'),
textDef(['a']),
elementDef(NodeFlags.None, 1, 'span'),
textDef(['a']),
textDef(['a']),
]);
expect(parents(vd)).toEqual([undefined, 0, undefined, 2, undefined]);
});
开发者ID:JSMike,项目名称:angular,代码行数:11,代码来源:view_def_spec.ts
示例6: it
it('should calculate parents for one level, multiple roots', () => {
const vd = viewDef(ViewFlags.None, [
elementDef(0, NodeFlags.None, null, null, 1, 'span'),
textDef(1, null, ['a']),
elementDef(2, NodeFlags.None, null, null, 1, 'span'),
textDef(3, null, ['a']),
textDef(4, null, ['a']),
]);
expect(parents(vd)).toEqual([null, 0, null, 2, null]);
});
开发者ID:Cammisuli,项目名称:angular,代码行数:11,代码来源:view_def_spec.ts
示例7: it
it('should calculate parents for multiple levels', () => {
const vd = viewDef(ViewFlags.None, [
elementDef(NodeFlags.None, null !, null !, 2, 'span'),
elementDef(NodeFlags.None, null !, null !, 1, 'span'),
textDef(null !, ['a']),
elementDef(NodeFlags.None, null !, null !, 1, 'span'),
textDef(null !, ['a']),
textDef(null !, ['a']),
]);
expect(parents(vd)).toEqual([null, 0, 1, null, 3, null]);
});
开发者ID:DanielKucal,项目名称:angular,代码行数:12,代码来源:view_def_spec.ts
注:本文中的@angular/core/src/view/index.textDef函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论