Write & use your own loader
This content is for v15. Switch to the latest version for up-to-date documentation.
Write & use your own loader
If you want to write your own loader, you need to create a class that
implements TranslateLoader
. The only required method is getTranslation
that must
return an Observable
. If your loader is synchronous, just use Observable.of
to create
an observable from your static value.
Example
Once you’ve defined your loader, you can provide it in your configuration by adding it to its providers
property.