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?
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.
Can someone please explain possible reasons for why one would get the following error when trying to use
dragulaService.options
inside thelink
function of a custom directive that injectsdragulaService
and in the html template of the directive includes a bag namedwhatever-bag
?Error: Bag named: "whatever-bag" already exists in same angular scope.
Yet if I do not use thedragulaService
, and instead listen withscope.$on
, there is no error?