Core: translate.instant vs translate.get

Created on 21 Apr 2017  路  1Comment  路  Source: ngx-translate/core

which is the better instant or get ? why we need get if instant allows us to have cleaner code without a lot of ugly embedded blocks ?

Most helpful comment

You can find more information in this discussion over here https://github.com/ngx-translate/core/issues/505#issuecomment-294913354.

From the documentation

instant(key: string|Array<string>, interpolateParams?: Object): string|Object: Gets the instant translated value of a key (or an array of keys). /!\ This method is synchronous and the default file loader is asynchronous. You are responsible for knowing when your translations have been loaded and it is safe to use this method. If you are not sure then you should use the get method instead.

>All comments

You can find more information in this discussion over here https://github.com/ngx-translate/core/issues/505#issuecomment-294913354.

From the documentation

instant(key: string|Array<string>, interpolateParams?: Object): string|Object: Gets the instant translated value of a key (or an array of keys). /!\ This method is synchronous and the default file loader is asynchronous. You are responsible for knowing when your translations have been loaded and it is safe to use this method. If you are not sure then you should use the get method instead.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bjornharvold picture bjornharvold  路  3Comments

IterationCorp picture IterationCorp  路  3Comments

crebuh picture crebuh  路  3Comments

egornoveo picture egornoveo  路  4Comments

pndewit picture pndewit  路  3Comments