如果在ng-if内部,在一个AngularJs表格中重复

时间:2022-07-21 20:33:57

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 :

嘿,每个人都是尝试使用ng-if ng-repeat内我的条件是,如果{ { dev[2]} } = =”“我想显示在< td >非Valide < / td >其他我只想显示数据在dev我一直在很多例子但没有看同样的原因是试图使用如果其他它甚至可以这样做这是我的代码:

<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 个解决方案

#1


2  

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

您可以使用ng-bind来绑定视图上的条件数据。

<td ng-bind="dev[2] != ''? 'Non Validé': 'Validé'"></td>

#1


2  

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

您可以使用ng-bind来绑定视图上的条件数据。

<td ng-bind="dev[2] != ''? 'Non Validé': 'Validé'"></td>