docs: fix issue #40941 (#40942)

setting the `hero` property as an optional property fixes the compilation
error: `Property 'hero' has no initializer and is not definitely assigned
in the constructor` when having the ts transpiler set to "strict" mode.

PR Close #40942
This commit is contained in:
Carl Fredrik Samson 2021-02-22 17:03:02 +01:00 committed by Andrew Kushnir
parent 4637df5551
commit e7453f15d5
1 changed files with 1 additions and 1 deletions

View File

@ -13,7 +13,7 @@ import { Hero } from '../hero';
})
export class HeroDetailComponent implements OnInit {
// #docregion input-hero
@Input() hero: Hero;
@Input() hero?: Hero;
// #enddocregion input-hero
constructor() { }