openpanel service hinzugefügt
This commit is contained in:
31
src/app/core/provider/openpanel.provider.ts
Normal file
31
src/app/core/provider/openpanel.provider.ts
Normal 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,
|
||||
]);
|
||||
}
|
||||
Reference in New Issue
Block a user