Skip to content

Commit

Permalink
docs: 鉁忥笍 fix fallback strategy code example
Browse files Browse the repository at this point in the history
Closes: jsverse#385
  • Loading branch information
shaharkazaz committed Dec 19, 2020
1 parent bfef699 commit a04d1fb
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions docs/docs/hack.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,17 @@ The fallback strategy is responsible for loading the fallback translation file,
When you need more control over this functionality, you can define your own strategy:

```ts
import { TranslocoMissingHandler } from '@ngneat/transloco';
import { TranslocoFallbackStrategy } from '@ngneat/transloco';

export class CustomHandler implements TranslocoMissingHandler {
handle(key: string, config: TranslocoConfig) {
export class CustomStrategy implements TranslocoFallbackStrategy {
getNextLangs(failedLang: string) {
return '...';
}
}

export const customMissingHandler = {
provide: TRANSLOCO_MISSING_HANDLER,
useClass: CustomHandler
export const customFallbackStrategy = {
provide: TRANSLOCO_FALLBACK_STRATEGY,
useClass: CustomStrategy
};
```

Expand Down

0 comments on commit a04d1fb

Please sign in to comment.