ionic-team / ionic-docs

https://ionicframework.com/docs
Apache License 2.0
583 stars 3k forks source link

bug: ion-icon doesn't show icons for angular #3368

Closed kovaldenys96 closed 8 months ago

kovaldenys96 commented 8 months ago

Describe the Bug

I initialized new angular project via ionic cli. But icons are not working according to the documentation. I see empty div without svg after using ion-icon.

 "@ionic/angular": "^7.5.0",
 "ionicons": "^7.2.1",

Example for angular in the documentation has the same issue if opened in stackBlitz. Link to doc: https://ionicframework.com/docs/api/icon

Expected Behavior

Icons should be shown

Steps to Reproduce

Open Angular's example in stackBlitz: https://ionicframework.com/docs/api/icon

Screenshots

Screenshot 2024-01-06 at 17 03 47

Operating System

MacOS Sonoma 14.2.1 (23C71)

Browser

Chrome + Safari

Version

120.0.6099.109 (Official Build) (arm64)

Additional Information

import svg from ionicons can be used directly and passed in icon input. it works but I'm not sure it's supposed to be used instead of name?

component.ts
import {add} from 'ionicons/icons'

export class Component {
  addIcon = add
}

component.html
<ion-icon icon="addIcon"></ion-icon>
averyjohnston commented 8 months ago

Thank you for the issue. I'm going to close this as a duplicate of https://github.com/ionic-team/ionic-docs/issues/2892.