How do you use paperjs events in angular2? I am having trouble integrating it. I tried below inside my component class but it doesn't seem to work.
this.currentAoi = this.paper.Path.Rectangle({
point: [100,100],
size: [100,100],
fillColor: 'green',
});
this.currentAoi.onMouseDrag = function(event) {
console.log(this.position);
console.log(event.delta);
}
Looking at the code you provide, I would say that you are not instantiating your
Rectangle
.You have to do (notice the
new
keyword):Here is a complete working example.