Created
January 8, 2020 14:13
-
-
Save umutyerebakmaz/7b27194db5d0e920faa6a5ff7f870726 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ngOnInit() { | |
this.route.params.subscribe(params => { | |
this.getUser(params.slug); | |
}); | |
} | |
getUser(slug: string) { | |
this.user$ = this.userPageUserGQL | |
.watch({ slug: slug }, { | |
fetchPolicy: 'cache-first' | |
}).valueChanges.pipe( | |
map(result => result.data.user) | |
); | |
} | |
updateTag(obj: any) { | |
const pageTitle = `${obj.firstName + ' ' + obj.lastName} (@${obj.userName})`; | |
this.seoService.addTitle(pageTitle); | |
this.seoService.addDefaultMetaTags(); | |
this.seoService.meta.updateTag({ property: 'og:title', content: pageTitle }); | |
this.seoService.meta.updateTag({ property: 'og:description', content: pageTitle }); | |
this.seoService.meta.updateTag({ name: 'description', content: pageTitle }); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment