Skip to content

Instantly share code, notes, and snippets.

@sean-perkins
Created October 13, 2023 17:36
Show Gist options
  • Save sean-perkins/f6d8a2c56c465c7be962e974ab39bb78 to your computer and use it in GitHub Desktop.
Save sean-perkins/f6d8a2c56c465c7be962e974ab39bb78 to your computer and use it in GitHub Desktop.
Registering all icons
import { Component } from '@angular/core';
import { IonContent, IonHeader, IonIcon, IonTitle, IonToolbar } from '@ionic/angular/standalone';
import * as icons from 'ionicons/icons';
import { addIcons } from 'ionicons';
@Component({
selector: 'app-home',
templateUrl: 'home.page.html',
styleUrls: ['home.page.scss'],
standalone: true,
imports: [IonHeader, IonToolbar, IonTitle, IonContent, IonIcon],
})
export class HomePage {
constructor() {
for (const iconName in icons) {
addIcons({ [iconName]: (icons as any)[iconName] });
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment