Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cdk): switch injectables to new scope API
- Loading branch information
Showing
44 changed files
with
1,248 additions
and
899 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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,18 @@ | ||
/** | ||
* @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 {APP_ROOT_SCOPE, InjectionToken} from '@angular/core'; | ||
|
||
// The token for the live announcer element is defined in a separate file from LiveAnnouncer | ||
// as a workaround for https://github.com/angular/angular/issues/22559 | ||
|
||
export const LIVE_ANNOUNCER_ELEMENT_TOKEN = | ||
new InjectionToken<HTMLElement | null>('liveAnnouncerElement', { | ||
scope: APP_ROOT_SCOPE, | ||
factory: () => null, | ||
}); |
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
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,31 @@ | ||
/** | ||
* @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 {DOCUMENT} from '@angular/common'; | ||
import {APP_ROOT_SCOPE, inject, InjectionToken} from '@angular/core'; | ||
|
||
|
||
/** | ||
* Injection token used to inject the document into Directionality. | ||
* This is used so that the value can be faked in tests. | ||
* | ||
* We can't use the real document in tests because changing the real `dir` causes geometry-based | ||
* tests in Safari to fail. | ||
* | ||
* We also can't re-provide the DOCUMENT token from platform-brower because the unit tests | ||
* themselves use things like `querySelector` in test code. | ||
* | ||
* This token is defined in a separate file from Directionality as a workaround for | ||
* https://github.com/angular/angular/issues/22559 | ||
* | ||
* @docs-private | ||
*/ | ||
export const DIR_DOCUMENT = new InjectionToken<Document>('cdk-dir-doc', { | ||
scope: APP_ROOT_SCOPE, | ||
factory: () => inject(DOCUMENT), | ||
}); |
Oops, something went wrong.