Currently, I am dynamically generating typescript code and facing an issue with quotes in my output:
let data = {
path: 'home',
component: '${homeComponentName}',
children:[]
};
let homeComponentName = 'HomeComponent'
let tpl= eval('`' + JSON.stringify(data) + '`')
The current result displays quotes around the value for component:
{
path: 'home',
component: 'HomeComponent',
children:[]
},
To rectify this, I aim to remove the quotes surrounding 'HomeComponent'. The expected updated results should be:
{
path: 'home',
component: HomeComponent,
children:[]
},