我有以下代码(Angular2 rc.5):
app.html
<div>
<myComp #compo-binding="my-comp" *ngIf="someCondition"></myComp>
{{ compo-binding.test }}
</div>
myComp的html被正确注入,但compo-binding.test
生成错误,表示测试在undefined上不存在
myComp.component.ts
import { Component } from "@angular/core"
@Component({
selector: "myComp",
exportAs: "my-comp",
templateUrl: "./myComp.html"
})
export class MyComp{
test: boolean = true
}
知道我对exportAs
做错了什么吗?