O
O
Oleg Morev2018-05-16 16:31:57
Angular
Oleg Morev, 2018-05-16 16:31:57

How to make each block with its own color in Angular so that the data is taken from the database?

Hello, I have the following code:

<div class="conteiner" *ngFor="let item of testTags">
    <div class="header">{{item.Name}}</div>
    <div class="description"></div>
</div>

There can be any number of these containers, and most importantly , the user sets the background and text color of each block himself, i.e. any color palette can be used and everything is stored in the database.
For all three divs , you need to load data with colors.
As I understand it, you can do this through [ngStyle], but I can’t figure out how to implement it :)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2018-05-16
@DpOLEGapx

For example

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question