我想知道做什么之间的区别是什么:
@Directive({
selector: 'input',
host: {
'(window:resize)': 'onResize($event)'
}
})
class InputDirective {
onResize(event:Event) {
...
}
}
和
@Directive({
selector: 'input'
})
class InputDirective {
@HostListener('window:resize', [$event])
onResize(event:Event) {
...
}
}