How to change default favicon icon in angular 2 app?

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


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