Last change
on this file was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
3.3 KB
|
Line | |
---|
1 | /**
|
---|
2 | * @license
|
---|
3 | * Copyright Google LLC All Rights Reserved.
|
---|
4 | *
|
---|
5 | * Use of this source code is governed by an MIT-style license that can be
|
---|
6 | * found in the LICENSE file at https://angular.io/license
|
---|
7 | */
|
---|
8 | import { DOCUMENT } from '@angular/common';
|
---|
9 | import { inject, InjectionToken } from '@angular/core';
|
---|
10 | /**
|
---|
11 | * Injection token used to inject the document into Directionality.
|
---|
12 | * This is used so that the value can be faked in tests.
|
---|
13 | *
|
---|
14 | * We can't use the real document in tests because changing the real `dir` causes geometry-based
|
---|
15 | * tests in Safari to fail.
|
---|
16 | *
|
---|
17 | * We also can't re-provide the DOCUMENT token from platform-brower because the unit tests
|
---|
18 | * themselves use things like `querySelector` in test code.
|
---|
19 | *
|
---|
20 | * This token is defined in a separate file from Directionality as a workaround for
|
---|
21 | * https://github.com/angular/angular/issues/22559
|
---|
22 | *
|
---|
23 | * @docs-private
|
---|
24 | */
|
---|
25 | export const DIR_DOCUMENT = new InjectionToken('cdk-dir-doc', {
|
---|
26 | providedIn: 'root',
|
---|
27 | factory: DIR_DOCUMENT_FACTORY,
|
---|
28 | });
|
---|
29 | /** @docs-private */
|
---|
30 | export function DIR_DOCUMENT_FACTORY() {
|
---|
31 | return inject(DOCUMENT);
|
---|
32 | }
|
---|
33 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGlyLWRvY3VtZW50LXRva2VuLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vc3JjL2Nkay9iaWRpL2Rpci1kb2N1bWVudC10b2tlbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7O0dBTUc7QUFFSCxPQUFPLEVBQUMsUUFBUSxFQUFDLE1B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