Advertisement
NelloRizzo

[AJS] Filters

Mar 14th, 2017
326
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. angular.module('Filters', [])
  2. .filter('reverse', function () {
  3.     var _this = this;
  4.     this.counter = 0;
  5.     return function (input) {
  6.         var result = '';
  7.         for (var i = 0; i < input.length; ++i)
  8.             result = input[i] + result;
  9.         return ++_this.counter + ' ' + result;
  10.     }
  11. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement