在Angular的自定义Component中实现双向数据绑定
有一篇讲的非常透彻: https://oomusou.io/angular/ngmodel/ 以下是应用举例: 在component.ts中,双向绑定的字段这么写: 1 2 3 4 5 6 7 @Input() topicSelection: string; @Output() topicSelectionChange = new EventEmitter(); public change() { this.topicSelectionChange.emit(this.topicSelection); } 在html