Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ function MyComponent_HostBindings(rf, ctx) {
if (rf & 1) {
i0.ɵɵlistener("dragover", function MyComponent_dragover_HostBindingHandler($event) {
return ctx.foo($event);
}, false, i0.ɵɵresolveDocument);
}, i0.ɵɵresolveDocument);
}
}
4 changes: 2 additions & 2 deletions packages/compiler-cli/test/ngtsc/ngtsc_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5067,7 +5067,7 @@ runInEachFileSystem((os: string) => {
const hostBindingsFn = `
hostBindings: function FooCmp_HostBindings(rf, ctx) {
if (rf & 1) {
i0.ɵɵlistener("click", function FooCmp_click_HostBindingHandler() { return ctx.onClick(); })("click", function FooCmp_click_HostBindingHandler($event) { return ctx.onDocumentClick($event.target); }, false, i0.ɵɵresolveDocument)("scroll", function FooCmp_scroll_HostBindingHandler() { return ctx.onWindowScroll(); }, false, i0.ɵɵresolveWindow);
i0.ɵɵlistener("click", function FooCmp_click_HostBindingHandler() { return ctx.onClick(); })("click", function FooCmp_click_HostBindingHandler($event) { return ctx.onDocumentClick($event.target); }, i0.ɵɵresolveDocument)("scroll", function FooCmp_scroll_HostBindingHandler() { return ctx.onWindowScroll(); }, i0.ɵɵresolveWindow);
}
}
`;
Expand Down Expand Up @@ -5198,7 +5198,7 @@ runInEachFileSystem((os: string) => {
hostVars: 4,
hostBindings: function FooCmp_HostBindings(rf, ctx) {
if (rf & 1) {
i0.ɵɵlistener("click", function FooCmp_click_HostBindingHandler($event) { return ctx.onClick($event); })("click", function FooCmp_click_HostBindingHandler($event) { return ctx.onBodyClick($event); }, false, i0.ɵɵresolveBody)("change", function FooCmp_change_HostBindingHandler() { return ctx.onChange(ctx.arg1, ctx.arg2, ctx.arg3); });
i0.ɵɵlistener("click", function FooCmp_click_HostBindingHandler($event) { return ctx.onClick($event); })("click", function FooCmp_click_HostBindingHandler($event) { return ctx.onBodyClick($event); }, i0.ɵɵresolveBody)("change", function FooCmp_change_HostBindingHandler() { return ctx.onChange(ctx.arg1, ctx.arg2, ctx.arg3); });
}
if (rf & 2) {
i0.ɵɵhostProperty("prop", ctx.bar);
Expand Down
1 change: 0 additions & 1 deletion packages/compiler/src/template/pipeline/src/instruction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ export function listener(
): ir.CreateOp {
const args = [o.literal(name), handlerFn];
if (eventTargetResolver !== null) {
args.push(o.literal(false)); // `useCapture` flag, defaults to `false`
args.push(o.importExpr(eventTargetResolver));
}
return call(
Expand Down
3 changes: 0 additions & 3 deletions packages/core/src/render3/instructions/listener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ export function setStashFn(fn: typeof stashEventListener) {
*
* @param eventName Name of the event
* @param listenerFn The function to be called when event emits
* @param useCapture Whether or not to use capture in event listener - this argument is a reminder
* from the Renderer3 infrastructure and should be removed from the instruction arguments
* @param eventTargetResolver Function that returns global target information in case this listener
* should be attached to a global object like window, document or body
*
Expand All @@ -61,7 +59,6 @@ export function setStashFn(fn: typeof stashEventListener) {
export function ɵɵlistener(
eventName: string,
listenerFn: (e?: any) => any,
useCapture?: boolean,
eventTargetResolver?: GlobalTargetResolver,
): typeof ɵɵlistener {
const lView = getLView<{} | null>();
Expand Down