Angular5 dynamic change header meta tag to switch website responsive on/off

user958916 Source

I tried to use Meta service introduced by Angular 4 but it's not working when trying to change following tags:

if (event instanceof NavigationEnd) {
  if (
    this._router.url.match(/^\/\w+\/(auth)\/\w+/g)       
  ) {
    this.meta.addTag({
      name: "viewport",
      content: "width=device-width, initial-scale=1, maximum-scale=1"
    });
  } else {
    this.meta.removeTag('name="viewport"');
  }
}

I want to show responsive login form only in /auth page and my main app page using non-responsive design.

angulartwitter-bootstraptypescriptresponsive-designmeta-tags

Answers

comments powered by Disqus