visurel / iconify-angular

Angular implementation of Iconify, strongly inspired from Iconify-React.
19 stars 14 forks source link

Indicate that users should import the IconModule to the app.module.ts file #18

Open HasanMothaffar opened 3 years ago

HasanMothaffar commented 3 years ago

Problem

I followed the steps that are described in the readme file of this repository, but there was a missing import that prevented me from using the icon set that your repository provides.

When I tried to include the icon component in one of my application's templates, I got the following error:

angular-iconfiy-error

Snapshots of my files

Here's a snapshot of my src/app.component.ts file.

my-files

And here's a snapshot of the icons object that I provided:

image

Here are the versions of my current setup tools:

@angular-devkit/architect       0.1201.1
@angular-devkit/build-angular   12.1.1
@angular-devkit/core            12.1.1
@angular-devkit/schematics      12.1.1
@schematics/angular             12.1.1
rxjs                            6.6.7
typescript                      4.3.5

How I was able to solve it

I was able to resolve this by adding the IconModule to the imports array of my app.module.ts file, like this:

import { IconModule } from '@visurel/iconify-angular';

@NgModule({
    declarations: [
        AppComponent,
    ],
    imports: [BrowserModule, IconModule],
    providers: [],
    bootstrap: [AppComponent],
})
export class AppModule {}

Suggestions

I think you should clarify things in your readme file about the missing import for the IconModule.

I would be glad to provide any information that you could use to resolve this.

KyleSmith0905 commented 1 year ago

Got stuck on this for a little, this is a much needed change to documentation!