title: AngularJS - Loop data with dynamic total number
body: <p>I try to create a input number that provided total number for loop my <code>span</code> tag <a href="http://jsfiddle.net/gu7K2/" rel="nofollow">like</a></p>
  
  <pre><code>&lt;div ng-app='myApp' ng-controller="myCtrl"&gt;
      &lt;input type="number" ng-model="number"&gt; 
      &lt;li ng-repeat="n in [] | range:{{number}}"&gt;&lt;span class="glyphicon glyphicon-star" &gt;{{n}}&lt;/span&gt;&lt;/li&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>And here is my JS</p>
  
  <pre><code>var app = angular.module('myApp', []);
  
  function myCtrl($scope){
  }    
  
  app.filter('range', function() {
    return function(val, range) {
      range = parseInt(range);
      for (var i=0; i&lt;range; i++)
        val.push(i);
      return val;
    };
  });
  </code></pre>
  
  <p>But that's not working. How to do that thanks</p>