openpanel service hinzugefügt

This commit is contained in:
2026-03-12 07:51:36 +01:00
parent 5cbe4525d1
commit 11a266879b
11 changed files with 296 additions and 28 deletions

View File

@@ -0,0 +1,31 @@
import { EnvironmentProviders, makeEnvironmentProviders } from '@angular/core';
import { OpenPanelConfig, OPENPANEL_CONFIG } from '@core/models/openpanel.model';
import { OpenPanelService } from '@core/services/openpanel.service';
/**
* Provides the OpenPanel analytics service for your Angular application.
*
* @example
* // app.config.ts
* import { provideOpenPanel } from './openpanel/openpanel.provider';
*
* export const appConfig: ApplicationConfig = {
* providers: [
* provideRouter(routes),
* provideOpenPanel({
* clientId: 'your-client-id',
* trackScreenViews: true,
* globalProperties: {
* app_version: '1.0.0',
* environment: 'production',
* },
* }),
* ],
* };
*/
export function provideOpenPanel(config: OpenPanelConfig): EnvironmentProviders {
return makeEnvironmentProviders([
{ provide: OPENPANEL_CONFIG, useValue: config },
OpenPanelService,
]);
}