Hi Guys,
Angular 2/4 version
I have a getbootstrap panel-heading with a title and my object is to change the background color of the panel heading based on the color code that comes with the record.
Records are pulled from a database and with each record, depending on the category the record belongs to it also bring with it a color code such as #b94a48. I like to change the panel-heading background-color to reflect the color code that came with the record. for argument sake: category_color: #b94a48.
question, how can i dynamically change the background-color in the css so it can be reflected back to the panel-heading background-color
as of now the color is static, what every i have in the css
CSS:
.panel-default > .panel-heading {
**background-color: #FFBABA; <!-- change this to reflect category_color: #b94a48 -->**
color: #b94a48;
font-weight: bold;
}
Part of the HTML
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"># {{userDetailTitle}}</h3>
</div>
<div class="panel-body">
Angular component.ts
this.userDetailTitle = this.returnArray && this.returnArray[0].userId + ' User Details';