this.droppableService.dragEnd$.subscribe( next:event=> this.onDragEnd(event));
This is right way of defining a subscriber function in angular6
.
But the problem is in the syntax of arrow function which you passed in subscribe call.
to define an arrow function syntax is
(arguments)=>{
......
code
.....
}
like if you have only one line of code in method body you can define the arrow function like this
(argument)=> console.log('for single line in the method block');
but in case of when you have single line of code but more then 2 arguments or need to define the type of the argument(like you do in your case next:event ) you need to follow the first one syntax .
so same problem you are facing in your case
this.droppableService.dragEnd$.subscribe( next:event=> this.onDragEnd(event));
when you pass the argument next:Event (next argument of Event type) it through an error while you are building this .
if you have intelliSense in your editor it gives you a warning that exepected 1 got 2 something like that.
so below define both syntax should work .
this.droppableService.dragEnd$.subscribe( (next:event)=> {this.onDragEnd(event)});
this.droppableService.dragEnd$.subscribe( next=>this.onDragEnd(event));