Angular 2 event binding use interpolation doesn't work inside template

前端 未结 1 1136
青春惊慌失措
青春惊慌失措 2021-01-25 07:22

I have simple click event binding

@Component({template:` 
DoLog
`}) export class AppComponent { eventStr:st
1条回答
  •  盖世英雄少女心
    2021-01-25 07:52

    You can't do that.

    Binding expressions have to be statically analyzable, so you cannot generate them dynamically. Same goes for anchors (discussion here).

    0 讨论(0)
提交回复
热议问题