📅  最后修改于: 2022-03-11 15:01:35.481000             🧑  作者: Mango
@Component({
selector: 'my-component',
template: ' My component
'
})
export class MyComponent {
@Input()
set name(str: string) {
this.service.setName(str);
console.log(str);
}
}