One method involves utilizing interpolation to insert an input value into the template:
@Component({
selector: 'tag',
inputs: ['color'],
template: `
<div id="test" style="background: {{color}}">
Some text
</div>
`,
})
class TestComponent {
}
However, my query is whether it is feasible to achieve a similar result in the following way:
@Component({
selector: 'tag',
inputs: ['color'],
template: `
<div id="test">
Some text
</div>
`,
styles: ['#test { background: {{color}}; }'],
})
class TestComponent {
}
Unfortunately, this alternative approach does not yield the desired outcome and I am unable to discover a resolution.
I appreciate any assistance or guidance on this matter.