I have encountered an issue where when I put the following code in my app.component.ts constructor, it does not work:
alert(this.translateService.translate('navigation.dashboard'));
But interestingly, if I place the same code in a submodule, it works perfectly fine.
Here is a snippet of my .json file:
"navigation": {
"dashboard": "Dashboard"
}
In addition, in my app.module.ts, I made sure to import the TranslocoRootModule as well:
import { TranslocoRootModule } from './transloco/transloco-root.module';
imports: [
...
HttpClientModule,
TranslocoRootModule
],
Is there anything that I might have overlooked?