apparentlymart/angularjs-viewhead

remove listener on destroy

cfey opened this issue · 0 comments

cfey commented

Every main view of my application has a view-title, but some have to wait for an AJAX call to come back

For example
"UserX - myApp"
when I go to UserY, the view title vanishes, so the default html title will be displayed which is the URL.
Then when the user is loaded, the ng-if will be rendered and just then the title shows "UserY - myApp"

Removing delete $rootScope.viewTitle fixed it for me