build(docs-infra): fix template type check errors (#33066)

In #33066 a limitation of Ivy's template type checker was fixed, where
all directive inputs would incorrectly allow `undefined` to be passed,
even when the input's type did not allow for it. Due to the fix, some
additional type errors were uncovered in AIO, where potential
`undefined` values would be passed to inputs that were not typed to
allow `undefined`.

PR Close #33066
This commit is contained in:
JoostK
2019-10-14 20:25:20 +00:00
committed by Miško Hevery
parent ece0b2d7ce
commit f05999730a
3 changed files with 7 additions and 7 deletions
@@ -63,7 +63,7 @@ export class CodeComponent implements OnChanges {
@Input() hideCopy: boolean;
/** Language to render the code (e.g. javascript, dart, typescript). */
@Input() language: string;
@Input() language: string | undefined;
/**
* Whether to display line numbers:
@@ -71,7 +71,7 @@ export class CodeComponent implements OnChanges {
* - If true: show
* - If number: show but start at that number
*/
@Input() linenums: boolean | number | string;
@Input() linenums: boolean | number | string | undefined;
/** Path to the source of the code. */
@Input() path: string;
@@ -81,12 +81,12 @@ export class CodeComponent implements OnChanges {
/** Optional header to be displayed above the code. */
@Input()
set header(header: string) {
set header(header: string | undefined) {
this._header = header;
this.ariaLabel = this.header ? `Copy code snippet from ${this.header}` : '';
}
get header(): string { return this._header; }
private _header: string;
get header(): string|undefined { return this._header; }
private _header: string | undefined;
@Output() codeFormatted = new EventEmitter<void>();