Angular JS Magazine

vineri, 19 septembrie 2014

Working with lowercase and uppercase Filters

This tip shows you how to deal with lowercase and uppercase buil-in filters:

<!DOCTYPE html>
<head lang="en">
    <meta charset="UTF-8">
    <script src="../angular/angular.min.js"></script>
    <link href="../bootstrap/css/bootstrap.css" rel="stylesheet" />
    <link href="../bootstrap/css/bootstrap-theme.css" rel="stylesheet" />
<div ng-app="" ng-init="atp=[
     { name: 'Nadal, Rafael', country: 'Spain', rank: 1},
     { name: 'Djokovic, Novak', country: 'Serbia' , rank: 2},
     { name: 'Federer, Roger', country: 'Switzerland' , rank: 3},
     { name: 'Wawrinka, Stan', country: 'Switzerland' , rank: 4},
     { name: 'Ferrer, David', country: 'Spain', rank: 5}]">

    <div id="atpPanel" class="panel">
        <h3 class="panel-header">ATP SINGLES RANKINGS</h3>
        <table class="table">
            <tr ng-repeat="item in atp">
                <td>{{ | uppercase}}</td>
                <td>{{ | lowercase}}</td>