What is wrong with this?
(function() {
'use strict';
angular
.module('app')
.run('pageTitle', pageTitle);
function pageTitle($rootScope, $http) {
$rootScope.$on('$routeChangeSuccess', function (event, current, previous) {
$rootScope.title = current.$$route.title;
});
}
})();
I´m getting this error
Error: ng:areq
Bad Argument
Argument 'fn' is not a function, got string