Angular-2 : Change favicon icon as per configuration

前端 未结 6 1677
你的背包
你的背包 2021-01-31 09:53

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

6条回答
  •  天命终不由人
    2021-01-31 10:38

    Worked well, no injections, no worries, simple code. But it's gonna be a pure javascript in your angular project.

    document.getElementById('appFavicon').setAttribute('href', '/your/icon/path.ico');
    

提交回复
热议问题