Angular Filter

In this example below you will see how to do a Angular Filter with some HTML / CSS and Javascript

Thumbnail
This awesome code was written by MikeDTech, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright MikeDTech ©
  • HTML
  • CSS
  • JavaScript
    <body ng-app="app" ng-controller="TestCtrl as test">
  <input type="text" ng-model="test.myString">
  <h2> {{ test.myString | capitalize }} </h2>
</body>


/*Downloaded from https://www.codeseek.co/MikeDTech/angular-filter-eZypdx */
    


/*Downloaded from https://www.codeseek.co/MikeDTech/angular-filter-eZypdx */
    angular.module('app', [])
.controller('TestCtrl', TestCtrl)
.filter('capitalize', CapitalizeFilter);


function TestCtrl() {
  this.myString = "hello world";
}

function CapitalizeFilter() {
  return function(text) {
   return text.toUpperCase(); 
  }
}


Comments