Skip to content

Commit

Permalink
docs: ✏️ remove broken links
Browse files Browse the repository at this point in the history
Closes: #730
  • Loading branch information
shaharkazaz committed Dec 8, 2023
1 parent b3ba603 commit 4de0aa5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 20 deletions.
10 changes: 3 additions & 7 deletions docs/docs/unit-testing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,16 @@ describe('AppComponent', () => {
});
```

You can find an example [here](https://github.com/ngneat/transloco/blob/master/apps/transloco-playground/src/app/on-push/on-push.component.spec.ts).

If you need to test `scopes`, you should add them as `languages`, for example:

```ts {6,7} title="transloco-testing.module.ts"
export function getTranslocoModule(options: TranslocoTestingOptions = {}) {
return TranslocoTestingModule.forRoot({
langs: {
en,
langs: {
en,
es,
'admin-page/en': admin,
'admin-page/es': adminSpanish,
'admin-page/es': adminSpanish,
},
translocoConfig: {
availableLangs: ['en', 'es'],
Expand All @@ -68,8 +66,6 @@ export function getTranslocoModule(options: TranslocoTestingOptions = {}) {
}
```

You can find an example [here](https://github.com/ngneat/transloco/blob/master/apps/transloco-playground/src/app/lazy/lazy.component.spec.ts).

Note that in order to import JSON files, you need to configure the TypeScript compiler by adding the following properties in `tsconfig.json`:

```json
Expand Down
20 changes: 7 additions & 13 deletions libs/transloco-locale/src/lib/transloco-locale.service.ts
Original file line number Diff line number Diff line change
@@ -1,33 +1,27 @@
import { Injectable, Inject, OnDestroy, inject } from '@angular/core';
import { inject, Injectable, OnDestroy } from '@angular/core';
import { TranslocoService } from '@ngneat/transloco';
import { Observable, BehaviorSubject, Subscription } from 'rxjs';
import { map, distinctUntilChanged, filter } from 'rxjs/operators';
import { BehaviorSubject, Subscription } from 'rxjs';
import { distinctUntilChanged, filter, map } from 'rxjs/operators';

import { isLocaleFormat, toDate } from './helpers';
import { getDefaultOptions } from './shared';
import {
TRANSLOCO_LOCALE_LANG_MAPPING,
TRANSLOCO_LOCALE_DEFAULT_LOCALE,
TRANSLOCO_LOCALE_CONFIG,
TRANSLOCO_LOCALE_CURRENCY_MAPPING,
TRANSLOCO_LOCALE_DEFAULT_CURRENCY,
TRANSLOCO_LOCALE_DEFAULT_LOCALE,
TRANSLOCO_LOCALE_LANG_MAPPING,
} from './transloco-locale.config';
import {
TRANSLOCO_DATE_TRANSFORMER,
TRANSLOCO_NUMBER_TRANSFORMER,
TranslocoDateTransformer,
TranslocoNumberTransformer,
} from './transloco-locale.transformers';
import {
Locale,
DateFormatOptions,
Locale,
LocaleConfig,
NumberStyles,
Currency,
ValidDate,
LocaleConfig,
LocaleToCurrencyMapping,
LangToLocaleMapping,
NumberFormatOptions,
} from './transloco-locale.types';

@Injectable({
Expand Down

0 comments on commit 4de0aa5

Please sign in to comment.