Added a test for if an empty titlePrefix is passed into the $changeTitle call

This commit is contained in:
Rachel Breeze
2019-10-02 20:52:22 +01:00
committed by Sebastiaan Janssen
parent dce4f49a3b
commit c9ea3656bd

View File

@@ -47,7 +47,11 @@ app.run(['$rootScope', '$route', '$location', 'urlHelper', 'navigationService',
var originalTitle = "";
$rootScope.$on('$changeTitle', function (event, titlePrefix) {
$rootScope.locationTitle = titlePrefix + " - " + originalTitle;
if (titlePrefix) {
$rootScope.locationTitle = titlePrefix + " - " + originalTitle;
} else {
$rootScope.locationTitle = originalTitle;
}
});
/** execute code on each successful route */