I am rendering a dynamic page, menu and other items in my application. I also want to change favicon as per configured by admin.
Say, for example, if when my pag
In index.html set link tag
and somewhere in your code import
import { Component, Inject } from '@angular/core';
import { DOCUMENT } from '@angular/common';
constructor(@Inject(DOCUMENT) private _document: HTMLDocument) {}
and use it like this
this._document.getElementById('appFavicon').setAttribute('href', '/your/icon/path.ico');
Angular 5.0 <
import { DOCUMENT } from '@angular/platform-browser';