How to change Angular CLI favicon

后端 未结 30 1615
谎友^
谎友^ 2020-12-07 16:32

How can I change the default favicon that is set by the Angular CLI?

I have tried many things, but it always shows the Angular logo as the favicon, even though I hav

30条回答
  •  天命终不由人
    2020-12-07 16:42

    I tried many of these solution but was unsuccessful. The one that worked for my angular 5 application was the below:

    index.html: Comment out your link tag

      
    

    .angular-cli.json: leave the item type as ".ico"

     "assets": [
          "assets",
          "favicon.ico"
        ],
    

    LASTLY..

    • In your project folder structure, have the favicon.ico inside the src ex: (C:\Dev\EPS\src). You do NOT need to have it in your asset folder since you aren't referencing it.

    • Make sure your icon is not broken (Your icon should be readable if viewed through window explorer aka no broken window icon)

    • must be 32 x 32 dimension

提交回复
热议问题