Angular Filter

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

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
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>

/*Downloaded from */

/*Downloaded from */
    angular.module('app', [])
.controller('TestCtrl', TestCtrl)
.filter('capitalize', CapitalizeFilter);

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

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