Skip to content

Commit c4b6fff

Browse files
committed
Add another example to block
1 parent a94aa78 commit c4b6fff

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

packages/telemetry/src/angular/index.ts

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export * from '../public-types';
3434
* This should be provided in your application's root module.
3535
*
3636
* @example
37+
* Basic usage:
3738
* ```typescript
3839
* import { ErrorHandler } from '@angular/core';
3940
* import { FirebaseErrorHandler } from '@firebase/telemetry-angular';
@@ -48,7 +49,27 @@ export * from '../public-types';
4849
* export class AppModule { }
4950
* ```
5051
*
51-
* @param telemetryOptions - {@link TelemetryOptions} that configure the Telemetry instance.
52+
* @example
53+
* Providing telemetry options:
54+
* ```typescript
55+
* import { ErrorHandler } from '@angular/core';
56+
* import { FirebaseErrorHandler } from '@firebase/telemetry-angular';
57+
*
58+
* @NgModule({
59+
* // ...
60+
* providers: [
61+
* {
62+
* provide: ErrorHandler,
63+
* useFactory: () => new FirebaseErrorHandler({ appVersion: '1.2.3' })
64+
* }
65+
* ],
66+
* // ...
67+
* })
68+
* export class AppModule { }
69+
* ```
70+
*
71+
* @param telemetryOptions - Optional. {@link TelemetryOptions} that configure the Telemetry instance.
72+
* To provide these options, you must use a `useFactory` provider as shown in the example above.
5273
*
5374
* @public
5475
*/

0 commit comments

Comments
 (0)