# How to change color of div according to api result

**URL:** <https://forum.ionicframework.com/t/how-to-change-color-of-div-according-to-api-result/129698>\
**Category:** ionic-v3\
**Created:** [May 4, 2018, 5:32pm UTC](https://forum.ionicframework.com/t/how-to-change-color-of-div-according-to-api-result/129698 "2018-05-04T17:32:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![visualarttech01](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/visualarttech01/32/118888_2.png) [@visualarttech01](https://forum.ionicframework.com/u/visualarttech01)\
**Post date:** [May 4, 2018, 5:32pm UTC](https://forum.ionicframework.com/t/how-to-change-color-of-div-according-to-api-result/129698/1 "2018-05-04T17:32:10Z")

</div>

How to change color of div according to api result data  
I’m building appointment calendar in which i have to show the user whether the appointment can be taken on the specific data or not.

---

<div class="post-metadata">

**Author:** ![anna\_liebt](https://avatars.discourse-cdn.com/v4/letter/a/bc8723/32.png) [@anna\_liebt](https://forum.ionicframework.com/u/anna_liebt)\
**Post date:** [May 4, 2018, 6:38pm UTC](https://forum.ionicframework.com/t/how-to-change-color-of-div-according-to-api-result/129698/2 "2018-05-04T18:38:01Z")

</div>

Hello,

maybe you are looking for something like that [https://codecraft.tv/courses/angular/built-in-directives/ngstyle-and-ngclass/](https://codecraft.tv/courses/angular/built-in-directives/ngstyle-and-ngclass/)

Best regards, anna-liebt

---

<div class="post-metadata">

**Author:** ![visualarttech01](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/visualarttech01/32/118888_2.png) [@visualarttech01](https://forum.ionicframework.com/u/visualarttech01)\
**Post date:** [May 7, 2018, 4:43pm UTC](https://forum.ionicframework.com/t/how-to-change-color-of-div-according-to-api-result/129698/3 "2018-05-07T16:43:47Z")

</div>

thanks for the help made my day @anna_liebt

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [July 19, 2021, 9:37pm UTC](https://forum.ionicframework.com/t/how-to-change-color-of-div-according-to-api-result/129698/4 "2021-07-19T21:37:11Z")

</div>

Closed on July 19, 2021, 9:37pm UTC


