/
githubmirror
/
angular
Обзор
Документация
Войти
/
githubmirror
/
angular
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
packages/common/src/xhr.ts
29 строк
680 B
Matthieu Riegler
refactor(core): use the `@Service` decorator where possible.
08 май 2026, 02:03
08 май 2026, 02:03
a7dab60
Код
Авторство
О чём код?
/** * @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 {Injectable, Service} from '@angular/core'; /** * A factory for `HttpXhrBackend` that uses the `XMLHttpRequest` browser API. */ @Service() export class BrowserXhr implements XhrFactory { build(): XMLHttpRequest { return new XMLHttpRequest(); } } /** * A wrapper around the `XMLHttpRequest` constructor. * * @publicApi */ @Injectable({providedIn: 'root', useExisting: BrowserXhr}) export abstract class XhrFactory { abstract build(): XMLHttpRequest; }