ui-router-metatags
ui-router-metatags copied to clipboard
Documentation on nested states
I am having trouble working with nested states. I have no idea how this modules handles nested states, hence can you please show us some examples on this topic?
I am guessing as stateChangeSuccess event is fired for every nested state and perhaps this module does not understand if the state have a parent. Hence it fallback to default title and description if current state is missing metaTags
I haven't looked into api documentation of UI-Router but is it possible to traverse state tree upward to perhaps instead of falling to default meta-tags, we could fallback to parent or if we could provide such option in the configuration options.
If that is impossible, how to reuse resolve dependency from a parent state? Because I do not wish to ajax same contents in child states...
Its been a while since I looked into this, but as far as I remember, the event is only thrown once.
But... is there actually a question in here? Do you have a problem with what the module does?
@thatisuday are you still having an issue here? or can this issue be closed?
With UI-Router you can inject resolved data:
resolve: {
identityResolve: ['identity', function(identity) {
return identity.initialize().$promise;
}]
},
metaTags: {
title: function(identityResolve) {
return identityResolve.meta.index.title + ' | ' + identityResolve.client.name;
},
description: function(identityResolve) {
return identityResolve.meta.index.description;
}
}