
var angular: any;
var num :any  = 5; // ok in JS, fehler in TS ohne any
num = "Hallo";

/// Quelle: http://jsfiddle.net/TheRoks/8uCT9/
var app = angular.module('myApp', []);

app.filter('numberFixedLen', function () {
 return function (n, len) {
  var num :any = parseInt(n, 10);
  len = parseInt(len, 10);
  if (isNaN(num) || isNaN(len)) {
   return n;
  }
  num = '' + num;
  while (num.length < len) {
   num = '0' + num;
  }
  return num;
 };
});