-
Notifications
You must be signed in to change notification settings - Fork 24.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(platform-browser):
DomEventsPlugin
should always be the last pl…
…ugin to be called for `supports()`. This fixes the issues when `BrowserModule` is not the first module imported. Fixes #37149 #37850
- Loading branch information
Showing
8 changed files
with
108 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/** | ||
* @license | ||
* Copyright Google LLC All Rights Reserved. | ||
* | ||
* Use of this source code is governed by an MIT-style license that can be | ||
* found in the LICENSE file at https://angular.io/license | ||
*/ | ||
|
||
import {NgZone} from '@angular/core'; | ||
|
||
/** | ||
* @publicApi | ||
*/ | ||
export interface EventManagerInterface { | ||
/** | ||
* Registers a handler for a specific element and event. | ||
* | ||
* @param element The HTML element to receive event notifications. | ||
* @param eventName The name of the event to listen for. | ||
* @param handler A function to call when the notification occurs. Receives the | ||
* event object as an argument. | ||
* @returns A callback function that can be used to remove the handler. | ||
*/ | ||
addEventListener(element: HTMLElement, eventName: string, handler: Function): Function; | ||
|
||
/** | ||
* Retrieves the compilation zone in which event listeners are registered. | ||
*/ | ||
getZone(): NgZone; | ||
} | ||
|
||
export abstract class EventManagerPlugin { | ||
constructor(private _doc: any) {} | ||
|
||
// Using non-null assertion because it's set by EventManager's constructor | ||
manager!: EventManagerInterface; | ||
|
||
abstract supports(eventName: string): boolean; | ||
|
||
abstract addEventListener(element: HTMLElement, eventName: string, handler: Function): Function; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters