How to add lucide-angular to the standalone Angular app?

Discussão em 'Angular' iniciado por Mohammad Reza Ghasemi, Novembro 11, 2024.

  1. I want to add lucide-icon package to my standalone Angular app. Accroding to it's document it's availabe for the Angular module but I'm using standalone mode, so how to add this package to the component?

    I tried this way but it gives me error.

    import { Component } from '@angular/core';
    import { RouterOutlet } from '@angular/router';
    import { NgClass, NgOptimizedImage } from '@angular/common';
    import { cx } from 'class-variance-authority';
    import { LucideAngularModule, Home } from 'lucide-angular';

    @Component({
    selector: 'app-root',
    standalone: true,
    imports: [RouterOutlet, NgOptimizedImage, NgClass, LucideAngularModule.pick({Home})],
    templateUrl: './app.component.html',
    styleUrl: './app.component.css',
    })
    export class AppComponent {
    title = 'tasko';
    protected readonly cx = cx;
    }

    Continue reading...

Compartilhe esta Página