mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
fix(docs-infra): rename "title" by "header" to avoid unwanted tooltips (#26396)
Closes #26174 PR Close #26396
This commit is contained in:
committed by
Misko Hevery
parent
ecd473bbce
commit
fc6dad40ac
@@ -7,7 +7,7 @@ import { CodeComponent } from './code.component';
|
||||
* Example usage:
|
||||
*
|
||||
* ```
|
||||
* <code-example language="ts" linenums="2" class="special" title="Do Stuff">
|
||||
* <code-example language="ts" linenums="2" class="special" header="Do Stuff">
|
||||
* // a code block
|
||||
* console.log('do stuff');
|
||||
* </code-example>
|
||||
@@ -19,7 +19,7 @@ import { CodeComponent } from './code.component';
|
||||
<!-- Content projection is used to get the content HTML provided to this component -->
|
||||
<div #content style="display: none"><ng-content></ng-content></div>
|
||||
|
||||
<header *ngIf="title">{{title}}</header>
|
||||
<header *ngIf="header">{{header}}</header>
|
||||
|
||||
<aio-code [ngClass]="classes"
|
||||
[language]="language"
|
||||
@@ -27,7 +27,7 @@ import { CodeComponent } from './code.component';
|
||||
[path]="path"
|
||||
[region]="region"
|
||||
[hideCopy]="hidecopy"
|
||||
[title]="title">
|
||||
[header]="header">
|
||||
</aio-code>
|
||||
`,
|
||||
})
|
||||
@@ -41,15 +41,15 @@ export class CodeExampleComponent implements AfterViewInit {
|
||||
@Input() region: string;
|
||||
|
||||
@Input()
|
||||
set title(title: string) {
|
||||
this._title = title;
|
||||
set header(header: string) {
|
||||
this._header = header;
|
||||
this.classes = {
|
||||
'headed-code': !!this.title,
|
||||
'simple-code': !this.title,
|
||||
'headed-code': !!this.header,
|
||||
'simple-code': !this.header,
|
||||
};
|
||||
}
|
||||
get title(): string { return this._title; }
|
||||
private _title: string;
|
||||
get header(): string { return this._header; }
|
||||
private _header: string;
|
||||
|
||||
@Input()
|
||||
set path(path: string) {
|
||||
|
||||
Reference in New Issue
Block a user