Sunday, September 24, 2017

conditional check while iterating the loop

I am working on HTML table with AngularJS. Below is my HTML code.

html code:

<table>
    <tr ng-repeat="data in myResults">
      <td style="text-align: center;"></td>
      <td style="text-align: center;"></td>
      <td style="text-align: center;"></td>
    </tr>
</table>

I am returning the value in myResults object and iterating and showing the values in the table.

I want to fill the particular <td> with color if the value is blank or null while iterating, Example) While iterating if i have the values of name and callerID but the dataPlan is blank, i need to fill the dataPlan <td> with yellow color and show the value of name and callerID in its individual cells..

I’m not sure how to include conditional check while iterating the loop and fill the cell with color if the value is blank/null. Any suggestions?

PS: Fill the cell with yellow color if the value in the cell is blank/null.

Source: AngularJS



from Angular Questions https://angularquestions.com/2017/09/25/conditional-check-while-iterating-the-loop/
via @lzomedia #developer #freelance #web

No comments:

Post a Comment