本文整理汇总了TypeScript中@angular/platform-browser/src/dom/dom_adapter.getDOM函数的典型用法代码示例。如果您正苦于以下问题:TypeScript getDOM函数的具体用法?TypeScript getDOM怎么用?TypeScript getDOM使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getDOM函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it('should set className via the class attribute', () => {
const d = getDOM().createElement('div');
getDOM().setAttribute(d, 'class', 'class1');
expect(d.className).toEqual('class1');
});
示例2: constructor
constructor(el: ElementRef) { getDOM().addClass(el.nativeElement, 'compiled'); }
示例3: clickOnElement
export function clickOnElement(anchorEl: any /** TODO #9100 */) {
var dispatchedEvent = getDOM().createMouseEvent('click');
getDOM().dispatchEvent(anchorEl, dispatchedEvent);
return dispatchedEvent;
}
示例4: it
it('should set a title on the injected document', () => {
titleService.setTitle('test title');
expect(getDOM().getTitle()).toEqual('test title');
expect(titleService.getTitle()).toEqual('test title');
});
示例5: afterEach
afterEach(() => { getDOM().setTitle(initialTitle); });
示例6: it
it('does not show profile link', () => {
const profileLink = getDOM().querySelector(cmpDebugElement.nativeElement, 'a.profile-link');
expect(profileLink).toBeFalsy();
});
示例7: expect
]).then(() => { expect(getDOM().getText(body)).toEqual('Works!'); });
示例8: it
it('can load more', () => {
const cmp:MicropostListComponent = cmpDebugElement.componentInstance;
const moreBtn = getDOM().querySelector(cmpDebugElement.nativeElement, '.moreBtn');
moreBtn.click();
expect(cmp.posts.length).toEqual(4);
});
示例9: expect
.then((rootTC: any) => {
let aboutDOMEl = rootTC.debugElement.children[0].nativeElement;
expect(getDOM().querySelectorAll(aboutDOMEl, 'h2')[0].textContent).toEqual('Features');
});
示例10: beforeEach
beforeEach(() => getDOM().resetBaseElement());