import {Component, AfterViewInit, ChangeDetectionStrategy, Input, Output, EventEmitter} from '@angular/core'; export class GoogleSignInSuccess { public googleUser: gapi.auth2.GoogleUser; constructor(googleUser: gapi.auth2.GoogleUser) { this.googleUser = googleUser; } } export class GoogleSignInFailure { } @Component({ selector: 'google-signin', template: '
', changeDetection: ChangeDetectionStrategy.OnPush }) export class GoogleSignInComponent implements AfterViewInit { private id: string = 'google-signin2'; // Render options @Input() private scope: string; private _width: number; get width(): string { return this._width.toString(); } @Input() set width(value: string) { this._width = Number(value); } private _height: number; get height(): string { return this._height.toString(); } @Input() set height(value: string) { this._height = Number(value); gapi.load('', ''); } private _longTitle: boolean; get longTitle(): string { return this._longTitle.toString(); } @Input() set longTitle(value: string) { this._longTitle = Boolean(value); } @Input() private theme: string; // Init params @Input() private clientId: string; @Input() private cookiePolicy: string; private _fetchBasicProfile: boolean; get fetchBasicProfile(): string { return this._fetchBasicProfile.toString(); } @Input() set fetchBasicProfile(s: string) { this._fetchBasicProfile = Boolean(s); } @Input() private hostedDomain: string; @Input() private openidRealm: string; @Output() googleSignInSuccess: EventEmitter