fix(ivy): adding event listeners for global objects (window, document, body) (#27772)
This update introduces support for global object (window, document, body) listeners, that can be defined via host listeners on Components and Directives. PR Close #27772
This commit is contained in:

committed by
Kara Erickson

parent
917c09cfc8
commit
6e7c46af1b
@ -31,6 +31,8 @@ import {DirectiveDefList, DirectiveTypesOrFactory, PipeDef, PipeDefList, PipeTyp
|
||||
import {PlayerHandler} from '../../src/render3/interfaces/player';
|
||||
import {ProceduralRenderer3, RComment, RElement, RNode, RText, Renderer3, RendererFactory3, RendererStyleFlags3, domRendererFactory3} from '../../src/render3/interfaces/renderer';
|
||||
import {HEADER_OFFSET, LView} from '../../src/render3/interfaces/view';
|
||||
import {destroyLView} from '../../src/render3/node_manipulation';
|
||||
import {getRootView} from '../../src/render3/util';
|
||||
import {Sanitizer} from '../../src/sanitization/security';
|
||||
import {Type} from '../../src/type';
|
||||
|
||||
@ -130,6 +132,11 @@ export class TemplateFixture extends BaseFixture {
|
||||
this.hostElement, updateBlock || this.updateBlock, 0, this.vars, null !,
|
||||
this._rendererFactory, this.hostView, this._directiveDefs, this._pipeDefs, this._sanitizer);
|
||||
}
|
||||
|
||||
destroy(): void {
|
||||
this.containerElement.removeChild(this.hostElement);
|
||||
destroyLView(this.hostView);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -171,6 +178,11 @@ export class ComponentFixture<T> extends BaseFixture {
|
||||
tick(this.component);
|
||||
this.requestAnimationFrame.flush();
|
||||
}
|
||||
|
||||
destroy(): void {
|
||||
this.containerElement.removeChild(this.hostElement);
|
||||
destroyLView(getRootView(this.component));
|
||||
}
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
Reference in New Issue
Block a user