Error: Bag named: "..." already exists in same angular scope... can't use dragulaService
mg1075 opened this issue · 1 comments
mg1075 commented
Can someone please explain possible reasons for why one would get the following error when trying to use dragulaService.options
inside the link
function of a custom directive that injects dragulaService
and in the html template of the directive includes a bag named whatever-bag
?
Error: Bag named: "whatever-bag" already exists in same angular scope.
Yet if I do not use the dragulaService
, and instead listen with scope.$on
, there is no error?
mg1075 commented
Added a controller to the custom directive, and put the dragulaService
call inside the controller, removing it from the directive's link
function. The error went away.