AngularJS : Filters - Uppercase

Uppercase filter in angularjs

by Sukanya Halder

HTML

<div class='description'>
<h3>
uppercase
</h3>
<h4>
Converts string to uppercase.
<br/>
{{ uppercase_expression | uppercase}}
</h4>
  Usage : In HTML Template Binding

</div>

<div ng-app='myModule' ng-controller='myController'>
  <!-- Date<span ng-model='date1'>{{date1}}</span><br />
  Date<span ng-model='date1'>{{date1|date:'medium'}}</span><br />
  Date<span ng-model='date1'>{{date1|date:'GGG'}}</span><br />
  Date<span ng-model='date1'>{{date1|date:'GGG'}}</span><br /> -->
  Description<br /><span ng-model='description'>{{description}}</span><br />
  Description<br /><span ng-model='description'>{{description|uppercase}}</span><br />
 </div>

CSS

span {
  
  margin: 12px;
  background: yellow;
}

a {
  font-family: verdana;
  font-weight: bold;
  font-size: 0.6em;
}

JavaScript

var app = angular.module('myModule', []);
app.controller('myController', ['$scope', function($scope) {
  $scope.date1 = 20161212;
  $scope.description = "Description is one of four rhetorical modes (also known as modes of discourse), along with exposition, argumentation, and narration. Each of the rhetorical modes is present in a variety of forms and each has its own purpose and conventions. The act of description may be related to that of definition. ";
}]);