angularjssmart-table

with smart table I display "male" if value = 0 and "female" if value = 1 in


I need something like this with angularjs and smart table

<tbody ng-show="!mc.isLoading">
    <tr ng-repeat="row in mc.displayed" st-select-row="row">
           if {{row.userName}} ==0
                <td>male</td>
           else
              <td>female</td>
    </tr>
</tbody>

Solution

  • You need to use ngIf or ngShow directive.

    The example below is using ngIf.

    <tbody ng-show="!mc.isLoading">
        <tr ng-repeat="row in mc.displayed" st-select-row="row">
            <td ng-if="row.userName === 0">male</td>
            <td ng-if="row.userName === 1">female</td>
        </tr>
    </tbody>