How to change Angular CLI favicon

后端 未结 30 1666
谎友^
谎友^ 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 17:00

    Ok, here in 2020 on 9.1.12. I don't understand why exactly this process is so difficult. I followed almost every post above and none of them worked for me.

    What DID work was this: Totally removing the favicon reference in index.html. It's totally counter intuitive but it works. You DON'T need to put it in the assets folder. I tried all of that but unfortunately none of those suggestions worked.

    index.html

    
    

    angular.json

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

    and when I run ng build --prod, the favicon is there. Displays on my live server too.

提交回复
热议问题