或者这个报错:Refused to load the image’http://localhost:4200/favicon.ico’ because it violates the following Content Security Policy directive: “default-src ‘none’”. Note that ‘img-src’ was not explicitly set, so ‘default-src’ is used as a fallback.
在报错地方如上图:加上感叹号:selectedHero!: Hero;或者加问号:selectedHero?: Hero;
修改后
前者是指我们不确定是否会传入这个参数,后者是指我们一定会给这个参数赋值