📜  角度中的@input 和@Output - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:21.158000             🧑  作者: Mango

代码示例1
Input is used to receive data in whereas Output is used to send data out.    
Output sends data out by exposing event producers, usually EventEmitter objects.    
@Component({
  selector: 'todo-item',
  ...
})
export class TodoItemComponent {
  @Input()  item
  @Output() onChange = new EventEmitter()
}