Search code examples
angularfavicon

How to change default favicon icon in angular 2 app?


  • 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)

Solution

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