build(docs-infra): update project structure to cli@9 10/12 (tsconfig.json) (#36015)

Update `tsconfig[.*].json`.
Also, all make necessary changes to ensure the example apps can be
successfully built with the new, stricter type-checking options.

PR Close #36015
This commit is contained in:
George Kalpakas
2020-03-17 22:28:48 +02:00
committed by Andrew Kushnir
parent 9afd360eba
commit f6adc0c3f9
9 changed files with 41 additions and 19 deletions

View File

@ -72,8 +72,8 @@
<h2>Non-null assertion operator (<code>!</code>)</h2>
<div>
<!-- #docregion non-null -->
<!--No color, no error -->
<p *ngIf="item">The item's color is: {{item!.color}}</p>
<!-- Assert color is defined, even if according to the `Item` type it could be undefined. -->
<p>The item's color is: {{item.color!.toUpperCase()}}</p>
<!-- #enddocregion non-null -->

View File

@ -1,6 +1,13 @@
import { Component } from '@angular/core';
interface Item {
name: string;
manufactureDate: Date;
color?: string | null;
price: number;
}
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
@ -9,10 +16,11 @@ import { Component } from '@angular/core';
export class AppComponent {
title = 'Template Expression Operators';
item = {
item: Item = {
name : 'Telephone',
manufactureDate : new Date(1980, 1, 25),
price: 98
color: 'orange',
price: 98,
};
nullItem = null;