@ngvip/analytics v0.1.0
Analytics
This library is for gathering metrics.
MixPanel
To use mixPanel you added the following into your AppModule under provider: [], its best practice to have dev analytics and prod analytics you can put those keys in environment.ts and environment.prod.ts of your Angular application. Documentation
{provide: MixPanelConfig, useClass: MixPanelConfig, useValue: { userId: AppData.getUser().id, apiToken: environment.mixpanel }}, MixPanelService,
To override the config inside a given component you can do the follwing
{provide: MixPanelConfig, useClass: MixPanelConfig, useValue: { userId: AppData.getUser().id, apiToken: environment.mixpanel }}, MixPanelService,
Code scaffolding
Run ng generate component component-name --project analytics to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module --project analytics.
Note: Don't forget to add
--project analyticsor else it will be added to the default project in yourangular.jsonfile.
Build
Run ng build analytics to build the project. The build artifacts will be stored in the dist/ directory.
Publishing
After building your library with ng build analytics, go to the dist folder cd dist/analytics and run npm publish.
Running unit tests
Run ng test analytics to execute the unit tests via Karma.
Further help
To get more help on the Angular CLI use ng help or go check out the Angular CLI Overview and Command Reference page.