/
githubmirror
/
components
Обзор
Документация
Войти
/
githubmirror
/
components
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/cdk/bidi/dir-document-token.ts
29 строк
978 B
Kristiyan Kostadinov
refactor(cdk/bidi): remove unnecessary factory
03 сен 2025, 09:51
03 сен 2025, 09:51
124184a
Код
Авторство
О чём код?
/** * @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.dev/license */ import {inject, InjectionToken, DOCUMENT} 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-browser 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', { providedIn: 'root', factory: () => inject(DOCUMENT), });