Skip to content
This repository has been archived by the owner on May 30, 2019. It is now read-only.

metaTags doesn't wait for promise resolve #22

Open
blauwhelm opened this issue Nov 22, 2016 · 3 comments
Open

metaTags doesn't wait for promise resolve #22

blauwhelm opened this issue Nov 22, 2016 · 3 comments

Comments

@blauwhelm
Copy link

blauwhelm commented Nov 22, 2016

Hi,

I'm unable to first get post data with a promise and then add this data to the metaTags object. It seems metaTags doesn't wait for a promise to resolve.

So this code will give undefined for portfolioItem.

.state('portfolioDetail', { url: '/portfolio/:slug', controller: 'PortfolioDetailController as portfolioDetail', templateUrl: 'templates/portfolio-detail.html', resolve: { /* @ngInject */ portfolioItem: function(PageService, $stateParams) { PageService.getPortfolioDetail($stateParams.slug) .then(function(response) { return response[0]; }); } }, metaTags: { /* @ngInject */ title: function(portfolioItem) { return portfolioItem; } } })

Am I missing something? Thanks in advance!

@johnjspiteri
Copy link

@blauwhelm please format your code and create a Plunker, and I would be happy to help?

@blauwhelm
Copy link
Author

@johnjspiteri Sorry for my extremely late response. I don't have the time to look at this problem unfortunaltly. Thank you for your response. Hopefully I will have some time later this year.

@Remco75
Copy link

Remco75 commented May 8, 2017

I got the exact same thing, When having a resolve that returns a promise, metatags does not wait for it and instead gives you the raw, un-invoked reference

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants