Curriculum
Course: AngularJS
Login

Curriculum

AngularJS

AngularJS Tutorial

0/65
Text lesson

Display with uppercase Filter

To display text in uppercase, apply an uppercase filter.

AngularJS Example

<table>
  <tr ng-repeat=”x in names”>
    <td>{{ x.Name }}</td>
    <td>{{ x.Country | uppercase }}</td>
  </tr>
</table>

Display the Table Index ($index)

To show the table index, include a <td> element with $index.

AngularJS Example

<table>
  <tr ng-repeat=”x in names”>
    <td>{{ $index + 1 }}</td>
    <td>{{ x.Name }}</td>
    <td>{{ x.Country }}</td>
  </tr>
</table>

Using $even and $odd

AngularJS Example

<table>
  <tr ng-repeat=”x in names”>
    <td ng-if=”$odd” style=”background-color:#f1f1f1″>{{ x.Name }}</td>
    <td ng-if=”$even”>{{ x.Name }}</td>
    <td ng-if=”$odd” style=”background-color:#f1f1f1″>{{ x.Country }}</td>
    <td ng-if=”$even”>{{ x.Country }}</td>
  </tr>
</table>