title: Angular 5 moment-range - typescript
body: <p>Hi I am porting an application from Angular 1 to Angular 5 (Ionic 1 to Ionic 3). </p>
  
  <p>In my Ionic 1 application I am using moment and moment-range</p>
  
  <pre><code>var range = moment.range(new Date(2018, 0, 1), new Date(2018, 11, 30));
  range.by('days', function (day) {
      // process each day
  });
  </code></pre>
  
  <p>I am trying to get this working with typescript.  I am using:</p>
  
  <p><a href="https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/moment-range" rel="nofollow noreferrer">https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/moment-range</a></p>
  
  <p><a href="https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/moment-range/moment-range-tests.ts" rel="nofollow noreferrer">https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/moment-range/moment-range-tests.ts</a></p>
  
  <p>I have the following code from the test code provided by the above link:</p>
  
  <pre><code>const range: momentRange.DateRange = new momentRange.DateRange(new Date(2018, 0, 11), new Date(2018, 11, 30));
  const it0: Iterable&lt;moment.Moment&gt; = range.by('days');
  </code></pre>
  
  <p>At this point, I am not sure how to iterate over the returned range.by() values?</p>