Skip to content

Commit

Permalink
feature/perfs — Memory leak.
Browse files Browse the repository at this point in the history
  • Loading branch information
jeandat committed May 20, 2016
1 parent 0e3fc6d commit 2d230b7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/character/detail/character-detail.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,16 @@
vm.remove = remove;
vm.toggleContent = toggleContent;
vm.showViewer = showViewer;

var unlisten;

activate();

////////////////

function activate() {
$log.debug(vm.title + ' instantiated');
$scope.$parent.$on('modal.shown', loadComics);
unlisten = $scope.$parent.$on('modal.shown', loadComics);
}

function openDetailPage() {
Expand All @@ -41,6 +43,7 @@
}

function loadComics() {
unlisten();
vm.isLoadingComics = true;
$timeout(waitAnimationEnd, 500);
///////////
Expand Down

0 comments on commit 2d230b7

Please sign in to comment.