ng-disabled is not working with respect to the values in column data field

311 Views Asked by At

I want to disabled the button Dissolve if the field in the status column is close or vise versa.

I tried applying ng-module n ng- disabled but something went wrong.

If anybody knows how to do it in Angularjs then plz help me out

<table>
    <tr>
        <th>Ticketid</th>
        <th>status</th>
        <th>Dissolve</th>
    </tr>
    <tr>
        <td>12345</td>
        <td>Close</td>
        <td><button>Dissolve</button></td>
    </tr>
    <tr>
        <td>4321</td>
        <td>open</td>
        <td><button>Dissolve</button></td>
    </tr>
</table>
1

There are 1 best solutions below

5
Sajeetharan On

You need to use ng-if and ng-disabled together,

 <tr>
    <td>4321</td>
    <td>open</td>
    <td ng-if="status ==='close'"><button ng-disabled="true">Dissolve</button></td>
</tr>