I had my meta tags working for Facebook and Twitter but I've somehow broken them. I looked at examples, but I can't see the issue. (There are no errors.) The tags just don't change from the defaults in index.html. I'm using Angular Universal 5.
Unlike the examples I found, I'm not writing the tags in the constructor. Not sure if that's a factor. I must be missing some rule of using the Meta service. Here's the code...
import { Meta } from '@angular/platform-browser';
...
constructor( ... private metaService: Meta ... ) {}
ngOnInit () {
...
// <!-- Facebook meta data -->
this.metaService.addTags([
{property: 'og:title', content: 'test' },
{property: 'og:url', content: 'url' },
]);
// <!-- Twitter meta data -->
this.metaService.addTag({name: 'twitter:title', content: 'test });
...
}