title: While using moment in Angular 7 getting Error:TypeError: moment is not a function
body: <p>followed below steps to install and use moment:</p>
  
  <pre><code>npm install moment --save
  </code></pre>
  
  <p>In app.component.ts file:</p>
  
  <pre><code>import * as moment from 'moment';
  
  
  
  export class AppComponent{
      currentDate = moment();
  </code></pre>
  
  <p>Also added below code in angular.json as per <a href="https://medium.com/@jek.bao.choo/steps-to-add-moment-js-to-angular-cli-f9ab28e48bf0" rel="nofollow noreferrer">this article</a>:</p>
  
  <pre><code>"scripts": ["./node_modules/moment/min/moment.min.js"]
  </code></pre>
  
  <p>I get: </p>
  
  <pre><code>TypeError: moment is not a function
  </code></pre>
  
  <p>Please check repro <a href="https://stackblitz.com/edit/angular-8lyvre" rel="nofollow noreferrer">demo</a></p>
  
  <p>If you know why I am getting this error please assist.</p>