build(docs-infra): enable `fullTemplateTypeCheck` (and fix failures) (#32980)
PR Close #32980
This commit is contained in:
parent
b2666a2857
commit
a2d2a5d572
|
@ -21,9 +21,9 @@
|
|||
</div>
|
||||
|
||||
<article class="api-list-container l-content-small docs-content">
|
||||
<div *ngFor="let section of filteredSections | async" >
|
||||
<div *ngFor="let section of (filteredSections | async)!" >
|
||||
<h2 *ngIf="section.items"><a [href]="section.path" [class.deprecated-api-item]="section.deprecated">{{section.title}}</a></h2>
|
||||
<ul class="api-list" *ngIf="section.items?.length">
|
||||
<ul class="api-list" *ngIf="section.items && section.items.length">
|
||||
<ng-container *ngFor="let item of section.items">
|
||||
<li class="api-item">
|
||||
<a [href]="item.path" [class.deprecated-api-item]="item.stability === 'deprecated'">
|
||||
|
|
|
@ -3,13 +3,14 @@ import { AfterViewInit, Component, ElementRef, Input, OnInit, QueryList, ViewChi
|
|||
import { CodeComponent } from './code.component';
|
||||
|
||||
export interface TabInfo {
|
||||
class: string|null;
|
||||
class: string;
|
||||
code: string;
|
||||
language: string|null;
|
||||
linenums: any;
|
||||
path: string;
|
||||
region: string;
|
||||
header: string|null;
|
||||
|
||||
header?: string;
|
||||
language?: string;
|
||||
linenums?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -46,7 +47,7 @@ export interface TabInfo {
|
|||
export class CodeTabsComponent implements OnInit, AfterViewInit {
|
||||
tabs: TabInfo[];
|
||||
|
||||
@Input() linenums: string;
|
||||
@Input() linenums: string | undefined;
|
||||
|
||||
@ViewChild('content', { static: true }) content: ElementRef<HTMLDivElement>;
|
||||
|
||||
|
@ -70,13 +71,14 @@ export class CodeTabsComponent implements OnInit, AfterViewInit {
|
|||
/** Gets the extracted TabInfo data from the provided code-pane element. */
|
||||
private getTabInfo(tabContent: Element): TabInfo {
|
||||
return {
|
||||
class: tabContent.getAttribute('class'),
|
||||
class: tabContent.getAttribute('class') || '',
|
||||
code: tabContent.innerHTML,
|
||||
language: tabContent.getAttribute('language'),
|
||||
linenums: tabContent.getAttribute('linenums') || this.linenums,
|
||||
path: tabContent.getAttribute('path') || '',
|
||||
region: tabContent.getAttribute('region') || '',
|
||||
header: tabContent.getAttribute('header')
|
||||
|
||||
header: tabContent.getAttribute('header') || undefined,
|
||||
language: tabContent.getAttribute('language') || undefined,
|
||||
linenums: tabContent.getAttribute('linenums') || this.linenums,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ export class TocComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||
isEmbedded = false;
|
||||
@ViewChildren('tocItem') private items: QueryList<ElementRef>;
|
||||
private onDestroy = new Subject();
|
||||
private primaryMax = 4;
|
||||
primaryMax = 4;
|
||||
tocList: TocItem[];
|
||||
|
||||
constructor(
|
||||
|
|
|
@ -3,8 +3,13 @@
|
|||
// Then re-export them from `navigation.service.ts`
|
||||
|
||||
export interface NavigationNode {
|
||||
// NOTE:
|
||||
// A navigation node should always have a title (to display to the user).
|
||||
// It may also have `url` (if it is a leaf node) or `children` (and no `url`), but it should
|
||||
// always have `title`.
|
||||
title: string;
|
||||
|
||||
url?: string;
|
||||
title?: string;
|
||||
tooltip?: string;
|
||||
hidden?: boolean;
|
||||
children?: NavigationNode[];
|
||||
|
|
|
@ -41,8 +41,8 @@ describe('NavigationService', () => {
|
|||
navService.navigationViews.subscribe(views => viewsEvents.push(views));
|
||||
|
||||
expect(viewsEvents).toEqual([]);
|
||||
httpMock.expectOne({}).flush({ TopBar: [ { url: 'a' }] });
|
||||
expect(viewsEvents).toEqual([{ TopBar: [ { url: 'a' }] }]);
|
||||
httpMock.expectOne({}).flush({ TopBar: [ { title: '', url: 'a' }] });
|
||||
expect(viewsEvents).toEqual([{ TopBar: [ { title: '', url: 'a' }] }]);
|
||||
});
|
||||
|
||||
it('navigationViews observable should complete', () => {
|
||||
|
@ -82,7 +82,7 @@ describe('NavigationService', () => {
|
|||
{ title: 'a', tooltip: 'a tip' },
|
||||
{ title: 'b' },
|
||||
{ title: 'c!'},
|
||||
{ url: 'foo' }
|
||||
{ title: '', url: 'foo' }
|
||||
];
|
||||
|
||||
beforeEach(() => {
|
||||
|
|
|
@ -14,7 +14,7 @@ export class SearchResultsComponent implements OnChanges {
|
|||
* The results to display
|
||||
*/
|
||||
@Input()
|
||||
searchResults: SearchResults;
|
||||
searchResults: SearchResults | null = null;
|
||||
|
||||
/**
|
||||
* Emitted when the user selects a search result
|
||||
|
@ -39,7 +39,7 @@ export class SearchResultsComponent implements OnChanges {
|
|||
}
|
||||
|
||||
// Map the search results into groups by area
|
||||
private processSearchResults(search: SearchResults) {
|
||||
private processSearchResults(search: SearchResults | null) {
|
||||
if (!search) {
|
||||
return [];
|
||||
}
|
||||
|
|
|
@ -37,8 +37,7 @@
|
|||
],
|
||||
"angularCompilerOptions": {
|
||||
"disableTypeScriptVersionCheck": true,
|
||||
// TODO: Fix template type errors and enable.
|
||||
// "fullTemplateTypeCheck": true,
|
||||
"fullTemplateTypeCheck": true,
|
||||
"strictInjectionParameters": true
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue