Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70432

How to add multiple if statements in a div

$
0
0

@MohanadZahed wrote:

I wanna add multiple conditions in one div in order to change the color dynamically like this:

<div tappable  [style.background]= "if x=1 let color be red ; if x=2 let color be green ;if x=3 let color be blue">
      <div>
      </div>
       ......
    </div>

I know how to use it for two conditions with the “?”. but I am new to ionic and could not apply multi conditions.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70432

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>