mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
2aecfb0f38
Format DevTools TypeScript files.
34 lines
1.2 KiB
TypeScript
34 lines
1.2 KiB
TypeScript
/**
|
|
* @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 {Component, computed, input} from '@angular/core';
|
|
import {MatIcon} from '@angular/material/icon';
|
|
import {MatTooltip} from '@angular/material/tooltip';
|
|
|
|
type Docs =
|
|
'view-encapsulation' | 'change-detection' | 'dependency-injection' | 'injector-hierarchies';
|
|
|
|
const URLS: {[key in Docs]: string} = {
|
|
'change-detection': 'https://angular.dev/api/core/ChangeDetectionStrategy',
|
|
'view-encapsulation': 'https://angular.dev/api/core/ViewEncapsulation',
|
|
'dependency-injection': 'https://angular.dev/guide/di',
|
|
'injector-hierarchies':
|
|
'https://angular.dev/guide/di/hierarchical-dependency-injection#types-of-injector-hierarchies',
|
|
};
|
|
|
|
@Component({
|
|
selector: 'ng-docs-ref-button',
|
|
templateUrl: './docs-ref-button.component.html',
|
|
styleUrl: './docs-ref-button.component.scss',
|
|
imports: [MatIcon, MatTooltip],
|
|
})
|
|
export class DocsRefButtonComponent {
|
|
protected readonly docs = input.required<Docs>();
|
|
protected readonly url = computed(() => URLS[this.docs()]);
|
|
}
|