angular/aio/content/examples/template-expression-operators/src/app/app.component.ts
Kristiyan Kostadinov e86a1d3441 docs: make all examples compatible with strict mode (#41999)
Turns on the `strict` compiler flag and resolves the compilation errors in the various AIO examples.

PR Close #41999
2021-05-17 10:42:18 -07:00

29 lines
500 B
TypeScript

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