本文整理汇总了TypeScript中@angular/core/src/view/index.rootRenderNodes函数的典型用法代码示例。如果您正苦于以下问题:TypeScript rootRenderNodes函数的具体用法?TypeScript rootRenderNodes怎么用?TypeScript rootRenderNodes使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了rootRenderNodes函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: it
it('should select root elements based on a node', () => {
rootData.selectorOrNode = rootNode;
const view = createRootView(rootData, compViewDef([
elementDef(NodeFlags.None, null, null, 1, 'div'),
]));
const rootNodes = rootRenderNodes(view);
expect(rootNodes).toEqual([rootNode]);
});
开发者ID:not-for-me,项目名称:angular,代码行数:8,代码来源:component_view_spec.ts
示例2: it
it('should select root elements based on a node', () => {
const view = createRootView(
compViewDef([
elementDef(0, NodeFlags.None, null, null, 0, 'div'),
]),
{}, [], rootNode);
const rootNodes = rootRenderNodes(view);
expect(rootNodes).toEqual([rootNode]);
});
开发者ID:Rowmance,项目名称:angular,代码行数:9,代码来源:component_view_spec.ts
示例3: it
it('should use root projectable nodes', () => {
const projectableNodes = [[document.createTextNode('a')], [document.createTextNode('b')]];
const view = createRootView(
compViewDef(hostElDef([], [ngContentDef(null, 0), ngContentDef(null, 1)])), {},
projectableNodes);
const rootNodes = rootRenderNodes(view);
expect(getDOM().childNodes(rootNodes[0])[0]).toBe(projectableNodes[0][0]);
expect(getDOM().childNodes(rootNodes[0])[1]).toBe(projectableNodes[1][0]);
});
开发者ID:rlugojr,项目名称:angular,代码行数:10,代码来源:ng_content_spec.ts
示例4: it
it('should include embedded views in root nodes', () => {
const {view: parentView} = createAndGetRootNodes(compViewDef([
anchorDef(NodeFlags.EmbeddedViews, null, null, 0, null, embeddedViewDef([
elementDef(NodeFlags.None, null, null, 0, 'span', [['name', 'child0']])
])),
elementDef(NodeFlags.None, null, null, 0, 'span', [['name', 'after']])
]));
const childView0 = Services.createEmbeddedView(parentView, parentView.def.nodes[0]);
attachEmbeddedView(parentView, asElementData(parentView, 0), 0, childView0);
const rootNodes = rootRenderNodes(parentView);
expect(rootNodes.length).toBe(3);
expect(getDOM().getAttribute(rootNodes[1], 'name')).toBe('child0');
expect(getDOM().getAttribute(rootNodes[2], 'name')).toBe('after');
});
开发者ID:JohnnyQQQQ,项目名称:angular,代码行数:16,代码来源:embedded_view_spec.ts
示例5: createAndGetRootNodes
function createAndGetRootNodes(
viewDef: ViewDefinition, context: any = null): {rootNodes: any[], view: ViewData} {
const view = createRootView(viewDef, context);
const rootNodes = rootRenderNodes(view);
return {rootNodes, view};
}
开发者ID:ballipongala,项目名称:angular,代码行数:6,代码来源:query_spec.ts
示例6: createAndGetRootNodes
function createAndGetRootNodes(
viewDef: ViewDefinition, ctx?: any): {rootNodes: any[], view: ViewData} {
const view = createRootView(viewDef, ctx || {});
const rootNodes = rootRenderNodes(view);
return {rootNodes, view};
}
开发者ID:rlugojr,项目名称:angular,代码行数:6,代码来源:ng_content_spec.ts
示例7: createAndGetRootNodes
function createAndGetRootNodes(viewDef: ViewDefinition): {rootNodes: any[], view: ViewData} {
const view = createRootView(services, viewDef);
const rootNodes = rootRenderNodes(view);
return {rootNodes, view};
}
开发者ID:JSMike,项目名称:angular,代码行数:5,代码来源:text_spec.ts
注:本文中的@angular/core/src/view/index.rootRenderNodes函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论