¿Qué es AngularJS? - Example 05

by pablolazaro

HTML

<div ng-app='filterExampleApp'>
    <p ng-controller='FilterExampleController'>
        {{text | toUpperCase}}       
    </p>
</div>

JavaScript

angular.module('filterExampleApp', [])
    .filter('toUpperCase', function() {
        return function(text, length, end) {
            if(text) {
                return text.toUpperCase();   
            }
        }
    });

function FilterExampleController($scope) {
    $scope.text = 'esto es un texto de prueba';   
}