This is below code which is for a custom favicon
<link rel="shortcut icon" sizes="16x16" href="favicon-16x16.png" type="image/png" />
in angular.cli
"assets": [
"assets",
"favicon-16x16.png"
],
It's working for this URL(main menu) : http://localhost:4200/maintenance
But it's not working for this URL(Sub Menu): http://localhost:4200/maintenance/colors
Also it's not working with full favicon URL
href="../src/favicon-16x16.png"
Folder structure :
I have tried with putting all type of URL's from my old question : Different between ./ , ../ , ../../ , ~/ on file path(URL) in asp.net
But it doesn't help me.
When you add a favicon to your site, it may not show up since your browser has 'saved' your site as one without a favicon. You need to clear the cache in your browser or use a different browser.
A favicon, short for "favorites icon," is a small graphic you can associate with your website for display in browsers like Internet Explorer, Firefox, Mozilla, Opera, Safari, iCab, and AOL Explorer.
Add image inside assets folder and update below path in index.html
<link rel="icon" href="assets/favicon.png" type="image/png">
Consider the fact that favicons are always heavily cached. Even window reload with cache cleaning may not help you. Try to add a get param to the favicon path, for example:
<link rel="icon" sizes="16x16" href="some-path/favicon-16x16.png?v=2" type="image/x-icon" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With