NG-ZORRO Icons user-o and login-o Error Solution

Discussão em 'Angular' iniciado por Kessnn, Janeiro 17, 2025.

  1. Kessnn

    Kessnn Guest

    I am encountering the following error while working with NG-ZORRO:

    [NG-ZORRO]: Error: [@ant-design/icons-angular]: the icon user-o does not exist or is not registered.
    [NG-ZORRO]: Error: [@ant-design/icons-angular]: the icon login-o does not exist or is not registered.


    These errors occur because the user-o and login-o icons cannot be found. I tried replacing them with user and login icons, but I still get the same error. I followed these steps to correctly register the icons in my project:

    1. In app.module.ts, I correctly registered the icons:

    import { UserOutline, LockOutline, IdcardOutline, LoginOutline } from '@ant-design/icons-angular/icons';

    const icons = [UserOutline, LockOutline, IdcardOutline, LoginOutline];

    @NgModule({
    imports: [NzIconModule.forRoot(icons)],
    providers: [{ provide: NZ_ICONS, useValue: icons }]
    })

    1. I updated the nzPrefixIcon usage in the HTML to user and login.
    2. I updated NG-ZORRO and @ant-design/icons-angular to the latest versions.

    4.Updated my register.component.html to use correct icon names:
    ​

    <nz-input-group nzPrefixIcon="user">
    <input type="text" nz-input formControlName="name" placeholder="Enter name" />
    </nz-input-group>


    However, I still keep getting the same error. How can I resolve the error related to user-o and login-o icons?

    Thank you!

    Continue reading...

Compartilhe esta Página