I am using Angular 7 project and I want to set my meta tag
<meta http-equiv="content-language" content="en">
dynamically. So I am trying to use the angular platform-browser
import { Title, Meta } from '@angular/platform-browser';
from the original document of Angular. Then I start typing like:
constructor(private meta: Meta) { }
ngOnInit() {
this.meta.updateTag({
httpEquiv: 'content-language', content: this.activeLang
});
}
It really does update my tag but it shows a bit different from the default:
The default http-equiv
<meta http-equiv="content-language" content="en">
After update
<meta httpequiv="content-language" content="en">
My question: Are they the same?
Try this:
this.meta.addTag({
'http-Equiv': 'content-language',
'content': this.activeLang
});
Reference: Angular 4 Meta: add http-equiv dynamically