Skip to content

Commit

Permalink
fix(Services): define external services as singletons
Browse files Browse the repository at this point in the history
ISSUES CLOSED: #2014
  • Loading branch information
benjamincharity committed Feb 12, 2020
1 parent 9798c06 commit 09790bf
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion terminus-ui/chart/src/amcharts.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const TS_AMCHARTS_TOKEN = new InjectionToken<TsAmChartsToken>('amCharts')
/**
* Expose amCharts via a service
*/
@Injectable()
@Injectable({ providedIn: 'root' })
export class TsAmChartsService {

constructor(
Expand Down
2 changes: 1 addition & 1 deletion terminus-ui/chart/src/chart.component.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

> Note: Since the end-user of this library is the one with the actual license to use amCharts, we let the consumer pass in the library.
Create a factory function to inject the needed libraries:
Create a factory function to inject the needed libraries and plugins:

```typescript
import { TS_AMCHARTS_TOKEN, TsAmChartsToken } from '@terminus/ui/chart';
Expand Down
1 change: 1 addition & 0 deletions terminus-ui/validators/src/validators.service.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<!-- END doctoc generated TOC please keep comment here to allow auto update -->


NOTE: This service is provided as a singleton by defining the `providedIn` property as `root`.

## Basic usage

Expand Down
2 changes: 1 addition & 1 deletion terminus-ui/validators/src/validators.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { urlValidator } from './validators/url/url';
/**
* Define a service that exposes custom form validators for use with reactive forms.
*/
@Injectable()
@Injectable({ providedIn: 'root' })
export class TsValidatorsService {
public creditCard = creditCardValidator;
public domain = domainValidator;
Expand Down

0 comments on commit 09790bf

Please sign in to comment.