8
  • os: win32 x64
  • angular-cli: 1.0.0-beta.22-1
  • node: 7.1.0

Repro steps.

  • Remove the line

    <link rel="icon" type="image/x-icon" href="favicon.ico"> 
    

    from index.html

  • ng build
  • ng serve
  • browse through http://localhost:4200/

It still shows the default angular favicon. Also tried the above steps after clearing the browser cache and still the same issue.

Below browser are used to reproduced the issue:

  • Chrome(Version 54.0.2840.99 m)
  • IE(Version 11.0.98600.18499)
Chandrahasa Rai
  • 427
  • 1
  • 5
  • 10
  • Possible duplicate of [How do I force a favicon refresh](http://stackoverflow.com/questions/2208933/how-do-i-force-a-favicon-refresh) – Neil Lunn May 17 '17 at 05:31
  • Just check the generated index.html page. If it doesn't have any link to the favicon, then it's simply a browser caching issue, and you should not care – JB Nizet May 17 '17 at 05:33

2 Answers2

9

Put your icon file into /public or /src/assets folder. This will make your icon visible to the browser. See the branch on Github.

vter
  • 1,881
  • 1
  • 20
  • 38
4

For Angular 9

  1. I created a favicon.png file in /src and dropped the image inside the file

  2. In angular.json add the file to assets

"assets": [
              "src/favicon.png"
          ]

  1. In index.html use this script
 <link rel="icon" type="image/x-icon" href="favicon.png">
  1. You may need to clear your cache if you're using Chrome.

     for Windows: CTRL F5 
     for Mac: CMD SHIFT R
    
Melissa Heying
  • 1,302
  • 1
  • 4
  • 4