0
我看过this,但它在我的代码中不起作用。 我使用Dragula
,在我的Angular2
应用程序中使用Typescript
。Dragula:获取被拖动项的类和id
我需要获取draged元素的元素的id。 这里是打字稿类的一部分:
constructor(private dragulaService: DragulaService) {
dragulaService.drop.subscribe((value) => {
this.onDrop(value.slice(1));
});
}
private onDrop(args) {
let [e, el] = args;
console.log("on Drop");
console.log(e);
console.log(el);
}
我知道el
包含draged元素,但我怎么能得到id列在打字稿HTML元素的?