pierreavn / angular-tabler-icons

Tabler Icons components library for your Angular applications
https://www.npmjs.com/package/angular-tabler-icons
MIT License
24 stars 2 forks source link

How to suppress warning output to the console log #31

Closed SuzGori closed 2 years ago

SuzGori commented 2 years ago

Thank you for allowing us to use your wonderful module. I would like to know if there is a way to prevent the following message from being output when one of the icons is not loading properly.

Tabler Icon not found: Refer to documentation on https://github.com/pierreavn/angular-tabler-icons

If not, would you please consider adding a feature?

pierreavn commented 2 years ago

Hi,

For now, there is no way to prevent this message. I can implement this feature with options, for example:

@NgModule({
  imports: [
    TablerIconsModule.pick(icons, {
        ignoreWarnings: true   // <----
    })
  ],
  exports: [
    TablerIconsModule
  ]
})
export class IconsModule { }

Can you tell me if it could be great for you?

SuzGori commented 2 years ago

I think it is very good. Please respond when you can afford to.

pierreavn commented 2 years ago

I've just released the 1.68.1 version of the package. Could you try to install it? with yarn add angular-tabler-icons@1.68.1

After that, you can easily disable warnings, using:

import { TablerIconsModule } from 'angular-tabler-icons';
import * as TablerIcons from 'angular-tabler-icons/icons';

@NgModule({
  imports: [
    TablerIconsModule.pick(TablerIcons, {
      // Ignore warnings, such as "Tabler Icon not found"
      ignoreWarnings: true,
    })
  ],
  exports: [
    TablerIconsModule
  ]
})
export class IconsModule { }
SuzGori commented 2 years ago

Quick response!!!!!!!!!!!!!!!!!!!!!!!!!!! Thank you!!!! It worked!