In my index.html <head>
I have the following element:
<link
rel="alternate"
type="application/rss+xml"
title="{{feedJobsTagName}} jobs feed"
href="{{feedJobTagsUrl}}"
ng-if="feedJobTagsUrl">
When I change routes to a new tag, I have a resolver that fetches the tag and updates the two properties on the root scope (TagShowCtrl
):
$rootScope.feedJobTagsUrl = '/feeds/jobs/'+tag.type+'s/'+tag.nameLower;
$rootScope.feedJobsTagName = tag.name;
If I refresh the page, I get the correct tag name, however if I just change routes by following links to a new tag name it seems to cache the first name and not update it with the new one:
.when('/tags/:slug/:id', {
templateUrl: 'partials/tags/show',
controller: 'TagShowCtrl',
resolve: {
tag: ['$route', 'Tag', function($route, Tag){
return Tag.get({ id: $route.current.params.id}).$promise;
}]
}
})