Skip to content

Instantly share code, notes, and snippets.

@shaharkazaz
Created July 17, 2020 06:55
Show Gist options
  • Save shaharkazaz/aa8d317f0c93efa4914fea7e649bcb22 to your computer and use it in GitHub Desktop.
Save shaharkazaz/aa8d317f0c93efa4914fea7e649bcb22 to your computer and use it in GitHub Desktop.
Adding the Transloco transpiler function
import { FunctionalTranspiler, TRANSLOCO_TRANSPILER } from '@ngneat/transloco';
import { FeatureFlagResolver } from './has-feature-flag';
@NgModule({
...
providers: [{
provide: TRANSLOCO_TRANSPILER,
useClass: FunctionalTranspiler
},
{
provide: 'hasFeatureFlag', // ====> The function name used in the translation
useClass: FeatureFlagResolver
}],
})
export class TranslocoRootModule {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment