/
githubmirror
/
components
Обзор
Документация
Войти
/
githubmirror
/
components
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/cdk/coercion/element.ts
17 строк
551 B
Naji
docs: replace angular.io links with angular.dev (#29734)
19 сен 2024, 13:57
Не верифицирован
19 сен 2024, 13:57
5782834
Код
Авторство
О чём код?
/** * @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 {ElementRef} from '@angular/core'; /** * Coerces an ElementRef or an Element into an element. * Useful for APIs that can accept either a ref or the native element itself. */ export function coerceElement<T>(elementOrRef: ElementRef<T> | T): T { return elementOrRef instanceof ElementRef ? elementOrRef.nativeElement : elementOrRef; }