There is a site something.com which has its favicon. There is also a sub-domain some.something.com, they are written in angular and have a common index.html , and the pages are already loaded <ng-view> . Is it possible to change the favicon for a sub-domain, it only comes to mind removeChild - remove a valid favicon with <head> and append - insert a new one .. But maybe there is a simpler option?
|
1 answer
Everything would be easier if it was possible to simply change the <link rel="icon"/> src <link rel="icon"/> , everyone would be happy. And so you have to delete the element, and create a new one, with a new path to the image.
In your case, you need to make a directive that will check the current domain and the presence of a sub-domain, and insert the necessary, in principle, this code into one condition.
The code will be something like this:
Если есть под-домен ссылка №1 иначе ссылка №2 At the same time, the ng-app should hang at the root (html).
And if you need dynamics, then with link you can only delete the element and create a new one in the head . Just change src will not work.
|