本文整理匯總了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());