How to import Javascript library in angular2 globally
<p>I'm trying to import the moment.js library in angular2.
I found the following solution as:</p>

<pre><code>import {Component} from 'angular2/core';
import * as moment from 'moment';

@Component({
  selector: 'app',
  template: require('./app.component.html')
})
export class AppComponent {
  moment:any = moment;
  constructor() {}
}
</code></pre>

<p>However, I do not want to import this to every component I have. Is there a way to inject it globally so I can use it in all my components?</p>