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 v16 and standalone components #332

Open
kgish opened this issue Sep 12, 2023 · 1 comment
Open

Angular v16 and standalone components #332

kgish opened this issue Sep 12, 2023 · 1 comment

Comments

@kgish
Copy link

kgish commented Sep 12, 2023

Now that Angular has introduced standalone components, I would like to know how I can use ngx-logger, for example in Angular v16 onwards.

@sey
Copy link

sey commented Sep 16, 2023

In app.config.ts:

import { ApplicationConfig, importProvidersFrom } from '@angular/core';
import { provideRouter } from '@angular/router';

import { routes } from './app.routes';
import { LoggerModule, NgxLoggerLevel } from 'ngx-logger';

export const appConfig: ApplicationConfig = {
  providers: [
    provideRouter(routes),
    importProvidersFrom(LoggerModule.forRoot({ level: NgxLoggerLevel.DEBUG })),
  ],
};

Official documentation importProvidersFrom

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

2 participants