我想将事件绑定到这个“tmp”,但是它也会附加到先前存在的按钮上,为什么?
constructor(private renderer :Renderer ,private element : ElementRef){
}
private appender(){
var tmp = this.renderer.createElement(this.element.nativeElement,'button');
this.renderer.listen(tmp, 'click', ( event:Event ) => console.log(event));
}
this "tmp"
? - Max Koretskyi