【发布时间】:2018-04-23 12:27:09
【问题描述】:
我得到了这个简单的代码:
@Component({
selector: 'app-tree',
template: `<div>{{content.name}}</div>
<app-tree [(content)]="contentChild"
*ngFor="let contentChild of content.childs"></app-tree>`
})
export class TreeComponent {
@Input() content: Content;
}
但是[(content)]="contentChild" 给我抛出以下错误:
ERROR Error: Uncaught (in promise): Error: Cannot assign to a reference or variable!
如何解决?
【问题讨论】:
标签: javascript angular typescript data-binding angular6