2

hey everyone am trying to use ng-if inside ng-repeat my condition is if {{dev[2]}} == "" i wanna display in the <td>Non Valide</td> else i just wanna display the data inside the dev i've been looking about a lot of exemples but nothing look the same cause am trying to use if else does it even possible to make it this way here's my code :

<table  class="table table-bordered"   >
        <thead><tr class="infoti" >
        <th>Id Dev</th>
        <th>Nom Dev </th>
        <th>Nom Ecu</th>
        <th>Etat</th>
        <th>Action</th>
        <tr>
        </thead>
        <tbody>     
<tr dir-paginate=" dev in devs | itemsPerPage:7 ">
            <td >{{dev[0]}}</td>
            <td>{{dev[1]}}</td>
            <td>{{dev[2]}}</td>
            <td ng-if({{dev[2]}} != "") >non validé</td>

<td><button class="btn btn-gray" ng-click="displaydata(dev[0])"  data-toggle="modal" data-target="#myModal" >Validé</button></td>
</tr>
        </tbody>
        </table> 

any help would be appreciated

1 Answer 1

2

You could use ng-bind to bind conditional data on view.

<td ng-bind="dev[2] != ''? 'Non Validé': 'Validé'"></td>
Sign up to request clarification or add additional context in comments.

1 Comment

<td ng-if="dev[2] == '' ">Non Validé</td> <td ng-if="dev[2] != '' "> Validé</td> i made this way and it worked but is it the proper way or should i use ng-bind

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.