Sibghat Ullah
Sibghat Ullah

Reputation: 43

Adding nested if else statements inside div

I have a problem, how to specify which picture should be added when value changes from certain point. I know i have done wrong coding but its because i don't know how to do it.

<img if({{h}} > 10): src="img/Weather_icon/11.png" style="width:90px;height:90px;" else if({{h}}>20):src="img/Weather_icon/11.png"else:src="img/Weather_icon/11.png" >

Upvotes: 0

Views: 283

Answers (1)

Mihai Vilcu
Mihai Vilcu

Reputation: 1967

You could use the ng-src directive.

<img ng-src="{{ h > 10 ? 'a.png' : 'b.png'}}" />

Upvotes: 1

Related Questions