且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何更改 Angular CLI 图标

更新时间:2023-09-30 09:30:10

制作一个同名的 png 图像 (favicon.png) 并在这些文件中更改名称:

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

index.html:

<link rel="icon" type="image/x-icon" href="favicon.png" />

angular-cli.json:

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

而且您将永远不会再看到有角度的默认图标.

And you will never see the angular default icon again.

尺寸应为 32x32,超过此尺寸将不显示.

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

注意:这不适用于 Angular 9

NOTE: This will not work with Angular 9

对于 angular 9,你必须将 favicon 放在资产中,然后给出类似的路径

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

<link rel="icon" type="image/x-icon" href="assets/favicon.png">