forked from microsoft/playwright
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request microsoft#3 from yjaaidi/handle-angular-non-event-…
…emitter-outputs Handle angular non-EventEmitter outputs
- Loading branch information
Showing
3 changed files
with
95 additions
and
9 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
17 changes: 17 additions & 0 deletions
17
tests/components/ct-angular/src/components/output.component.ts
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,17 @@ | ||
import { DOCUMENT } from "@angular/common"; | ||
import { Component, Output, inject } from "@angular/core"; | ||
import { Subject, finalize } from "rxjs"; | ||
|
||
@Component({ | ||
standalone: true, | ||
template: `OutputComponent`, | ||
}) | ||
export class OutputComponent { | ||
@Output() answerChange = new Subject().pipe( | ||
/* Detect when observable is unsubscribed from, | ||
* and set a global variable `hasUnsubscribed` to true. */ | ||
finalize(() => ((this._window as any).hasUnsubscribed = true)) | ||
); | ||
|
||
private _window = inject(DOCUMENT).defaultView; | ||
} |
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