R
R
Rishat Sultanov2017-08-09 08:10:54
JavaScript
Rishat Sultanov, 2017-08-09 08:10:54

How to return true with comparison operations in Angular 1.2.14?

Good morning :)

<td 
          data-ng-class="{'danger': diff_range_start_time >= 10}" 
          data-ng-bind="getCell(data, 'start_time')"
       ></td>

Here I wrote pseudo code, how can I fix syntax errors and convert my logic to Angular? To make it work and assign a class with the danger parameter if diff_range_start_time >=10?
Thanks for your help in advance :)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0X12eb, 2017-08-09
@0X12eb

What does getCell return and why should the function pass a string as the second parameter.

<table>
  <tr ng-repeat="x in vm.data" ng-class="{danger: vm.diff_range_start_time >= 10}">
    <td>{{ x.Name }}</td>
    <td>{{ x.Country }}</td>
  </tr>
</table>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question