Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Angular 16 with a standalone component #8

Open
wmbutler opened this issue Oct 27, 2023 · 0 comments
Open

Angular 16 with a standalone component #8

wmbutler opened this issue Oct 27, 2023 · 0 comments

Comments

@wmbutler
Copy link

Hey there. I've imported the module into my angular 16 project, but looks like standalone components don't accept the NgxSimpleIconsModule.pick({microsoftword}) syntax.

import { IconNameEnum } from 'ngx-simple-icons';
import { NgxSimpleIconsModule } from 'ngx-simple-icons';
import { microsoftword } from 'ngx-simple-icons';

@Component({
	selector: 'policyco-attachment-form',
	standalone: true,
	imports: [
		CommonModule,
		InputDirective,
		ReactiveFormsModule,
		NgxSimpleIconsModule.pick({microsoftword}),
	],
	templateUrl: './attachment-form.component.html',
	styles: [
		`
		:host {
    @apply flex justify-center mt-4 animate-in fade-in slide-in-from-top h-fit;
}
		`
	],
})

export class AttachmentFormComponent {
  public iconNames = IconNameEnum;
}

I get this error:

'imports' contains a ModuleWithProviders value, likely the result of a 'Module.forRoot()'-style call. These calls are not used to configure components and are not valid in standalone component imports - consider importing them in the application bootstrap instead.(-992012)
Type 'ModuleWithProviders<NgxSimpleIconsModule>' is not assignable to type 'readonly any[] | Type<any>'.ts(2322)
⚠ Error (TS2322)  | 
Type 
 is not assignable to type 
 .
(alias) class NgxSimpleIconsModule
import NgxSimpleIconsModule

Any thoughts on how this could be engineered to be compatible with standalone components? Thanks for your help. Looks like this isn't heavily maintained so I inderstand if it's not a priority.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant