本文整理汇总了TypeScript中@angular/core/src/view/index.Services.createDebugContext方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Services.createDebugContext方法的具体用法?TypeScript Services.createDebugContext怎么用?TypeScript Services.createDebugContext使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@angular/core/src/view/index.Services
的用法示例。
在下文中一共展示了Services.createDebugContext方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it('should provide data for other nodes based on the nearest element parent', () => {
const view = createViewWithData();
const compView = asElementData(view, 0).componentView;
const debugCtx = Services.createDebugContext(compView, 1);
expect(debugCtx.renderNode).toBe(asElementData(compView, 0).renderElement);
});
示例2: it
it('should provide data for text nodes', () => {
const view = createViewWithData();
const compView = asElementData(view, 0).componentView;
const debugCtx = Services.createDebugContext(compView, 2);
expect(debugCtx.componentRenderElement).toBe(asElementData(view, 0).renderElement);
expect(debugCtx.renderNode).toBe(asTextData(compView, 2).renderText);
expect(debugCtx.injector.get(AComp)).toBe(compView.component);
expect(debugCtx.component).toBe(compView.component);
expect(debugCtx.context).toBe(compView.context);
});