Current Behavior:
import { Component, OnInit } from '@angular/core';
import { TranslateService } from '@ngx-translate/core';
@component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'],
})
export class AppComponent implements OnInit {
constructor(private translate: TranslateService) {
translate.setDefaultLang('en');
translate.use('en');
}
columnConfigs1 = [
{
"columnName": {{'wlcmMsg' | translate}}, // Unable to access translation file values here
"columnInternalName": "name",
"type": "String",
"autoGroupColumnDef": true,
"filter": true,
"pinned": "left"
}
]
}
I am unable to fetch translation file values as shown above in bold. Can anyone suggest how to sort out this issue ?
What would be my approach to achieve the above use case ?
Expected Behavior:
Referring to the above code it should be able access translation file values in type script in the below location as shown:
.......
.......
columnConfigs1 = [
{
"columnName": {{'wlcmMsg' | translate}},
"columnInternalName": "name",
"type": "String",
"autoGroupColumnDef": true,
"filter": true,
"pinned": "left"
}
]
.......
Environment:
Current Behavior:
import { Component, OnInit } from '@angular/core';
import { TranslateService } from '@ngx-translate/core';
@component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'],
})
export class AppComponent implements OnInit {
constructor(private translate: TranslateService) {
translate.setDefaultLang('en');
translate.use('en');
}
columnConfigs1 = [
{
"columnName": {{'wlcmMsg' | translate}}, // Unable to access translation file values here
"columnInternalName": "name",
"type": "String",
"autoGroupColumnDef": true,
"filter": true,
"pinned": "left"
}
]
}
I am unable to fetch translation file values as shown above in bold. Can anyone suggest how to sort out this issue ?
What would be my approach to achieve the above use case ?
Expected Behavior:
Referring to the above code it should be able access translation file values in type script in the below location as shown:
.......
.......
columnConfigs1 = [
{
"columnName": {{'wlcmMsg' | translate}},
"columnInternalName": "name",
"type": "String",
"autoGroupColumnDef": true,
"filter": true,
"pinned": "left"
}
]
.......
Environment: