The Transpiler
A deep dive into one of Transloco's main components, the transpiler.
DefaultTranspiler
Functional Transpiler
Usage
import { FFService } from './feature-flag.service';
import { TranslocoTranspilerFunction } from '@jsverse/transloco';
class FeatureFlagResolver implements TranslocoTranspilerFunction {
constructor(private featureFlagService: FFService) {}
transpile(...args: string[]): any {
const [flagName, trueValue, falseValue] = args;
return this.featureFlagService.hasFF(flagName) ? trueValue : falseValue;
}
}Usage Notes
Custom Transpiler
Was this helpful?

