Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Conditional data show hide in Angularjs

I am working on an application where I have to generate a table report, based on user filter.

And user can filter the result and submit new query using different parameter. Depending one of the checkbox and the results lists,I have to show hide a column in table.

How I can implement in an Angular way?

like image 498
arnold Avatar asked Aug 01 '26 08:08

arnold


1 Answers

You can use ng-show with condition, like this:

<select ng-model="filter">
  <option value="blah"></option>
  <option value="foo"></option>
</select>
<table>
  <tr>
    <td>1</td>
    <td ng-show="filter=='blah'">blah blah</td>
  </tr>
  <tr>
    <td>2</td>
    <td ng-show="filter=='blah'">foo foo</td>
  </tr>
</table>
like image 116
SET Avatar answered Aug 03 '26 23:08

SET