Files
phx-frontend-plugin-webcomp…/src/app/app.config.ts

26 lines
1013 B
TypeScript

import { ApplicationConfig, provideBrowserGlobalErrorListeners, provideZoneChangeDetection, inject } from '@angular/core';
import { provideRouter } from '@angular/router';
import { routes } from './app.routes';
import { provideHttpClient } from '@angular/common/http';
import { providePhoenixPluginWithPrimeNG } from '@phx/shared-ui';
import { environment } from '../environments/environment';
import { apolloProvider } from './apollo.provider';
import { AuthGuard } from './auth-guard';
export const appConfig: ApplicationConfig = {
providers: [
provideBrowserGlobalErrorListeners(),
provideZoneChangeDetection({ eventCoalescing: true }),
...providePhoenixPluginWithPrimeNG({ stripTrailingSegments: routes.map(route => route.path!).filter(path => (path?.length??0) > 0) }),
provideRouter(routes),
provideHttpClient(),
...(environment.production ? [] : [
...apolloProvider(),
{
provide: AuthGuard,
useFactory: () => new AuthGuard(),
},
])
]
};