I load all my state level translation text via REST API asynchronously, Which is working totally fine when I use translation filter in HTML file but same is not working with angular-formly (when my API takes little time to give response).
Resolution : Angular-formly can put watch on label the way angular does and update translation text.
Here I am giving my code snippet to get clear idea
class LoginController {
constructor($translate){
this.$translate = $translate;
this.fields = this.getFields();
}
// Return Login form fields
getFields(){
return [
{
key: 'email',
type: 'input',
templateOptions: {
label: this.$translate.instant('REGISTER_LABEL_EMAIL') **// This not getting translated once API response comes**
},
expressionProperties: {
'templateOptions.label': '"REGISTER_LABEL_EMAIL" | translate' **// This not getting translated once API response comes**
}
}
}
I load all my state level translation text via REST API asynchronously, Which is working totally fine when I use translation filter in HTML file but same is not working with angular-formly (when my API takes little time to give response).
Resolution : Angular-formly can put watch on label the way angular does and update translation text.
Here I am giving my code snippet to get clear idea
}