我决定学习Angular 4并按照https://angular.io/tutorial/toh-pt3上的教程进行操作.但是,问题又出现了.这是什么
@Input () hero: Hero;
Run Code Online (Sandbox Code Playgroud)
它是为了什么?它有什么作用?这是什么意思?
这是代码.英雄details.component.ts
import { Component, Input } from '@angular/core';
import { Hero } from "./hero";
@Component({
selector: 'hero-detail',
templateUrl: './hero-detail.component.html'
})
export class HeroDetailComponent {
@Input() hero: Hero;
}
Run Code Online (Sandbox Code Playgroud)
下面是对文件的另一个代码app.components.ts,app.components.html,hero-details.components.html
如果有人可以,请解释一下