How to access global variable in Angular 2 Component
<p>I want to access google api library from angular 2 module in typescript.
How to do that.
When i try to access (gapi) i get the undefined. is there any NPM module that work as typescript library in angular 2 to which i can use or i have to use the js file.</p>

<p>Following is the module code and library reference:</p>

<pre><code> &lt;script src="https://apis.google.com/js/client.js?onload=handleClientLoad"&gt;&lt;/script&gt;
</code></pre>

<p>.</p>

<pre><code>    @Component({

    selector: "main-app",
    template: "{{title}}",
    providers: [HTTP_PROVIDERS, AuthService]

})
export class AppComponent implements OnInit {
    public title: string = '';
    constructor(private _authService: AuthService) {
        var gapi: any;
        console.log(gapi); // undefined
    }
    ngOnInit() {

        this._authService.getAuthSettings().subscribe((set: AppSetting) =&gt; {
            this.title = set.Scopes;
        });
    }

};
</code></pre>