javascript - AddEventListener with Angular and remove it -
i needed add event listener angular application. external plugin listening event trigger action.
i did :
$window.addeventlistener('itemloaded', itemloaded, false);
it works don't find way remove event when change state (i use ui-router).
do know better way angular add event , remove it, if state change ?
thanks help.
if code being called inside of controller, listen $scope.$destroy()
event , remove listener when controller unloads.
where calling from?
Comments
Post a Comment