我是angular docs以下为拖动创建属性指令,但ondrag
事件不工作。另一端mouseenter
和mouseleave
工作正常(在doc中提到)。有什么建议么 ?如何在角度2.0中创建拖动属性指令?
import {Directive, ElementRef, Input} from 'angular2/core';
@Directive({
selector: '[myHighlight]',
host: {
'(ondrag)' : 'onDrag()'
}
})
export class HighlightDirective {
//constructor(private el: ElementRef) { }
onDrag(){
console.log("onDrag...");
}
}
看到这个[plnkr](http://plnkr.co/edit/LD5FJaI4OOFbKfvhjD4e?p=preview) –