How to change Angular CLI favicon

后端 未结 30 1665
谎友^
谎友^ 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条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-07 16:52

    Make a png image with same name (favicon.png) and change the name in these files:

    index.html:

    
    

    angular-cli.json:

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

    And you will never see the angular default icon again.

    Size should be 32x32, if more than this it will not display.

    NOTE: This will not work with Angular 9

    For angular 9 you have to put favicon inside assets then give path like

提交回复
热议问题