You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello!
When using the Transloco API on a component, sometimes you have to manually pass a scope object to the selectTranslation method for it to work correctly:
// scope1 comes from injecting TRANSLOCO_SCOPE in the component this.translocoService.selectTranslateObject('component.translationObj', {}, scope1).subscribe((translation) => { console.log(translation); });
My question is, should you have to manually load the translation scope? Is this the case because this component belongs to a non-lazy loaded module?
Also, just a heads up: in the method declaration, selectTranslateObject does not accept a TranslocoScope object on the lang parametes, like selectTranslate does (lang is declared only as a string).
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello!
When using the Transloco API on a component, sometimes you have to manually pass a scope object to the selectTranslation method for it to work correctly:
// scope1 comes from injecting TRANSLOCO_SCOPE in the component
this.translocoService.selectTranslateObject('component.translationObj', {}, scope1).subscribe((translation) => { console.log(translation); });
My question is, should you have to manually load the translation scope? Is this the case because this component belongs to a non-lazy loaded module?
Also, just a heads up: in the method declaration, selectTranslateObject does not accept a TranslocoScope object on the lang parametes, like selectTranslate does (lang is declared only as a string).
Beta Was this translation helpful? Give feedback.
All reactions