argos/dmp-frontend/src/app/login/googgle-sign-in/googgle-sign-in.component.ts

60 lines
1.5 KiB
TypeScript
Raw Normal View History

2017-12-18 16:55:12 +01:00
import { AuthService } from '../../services/auth/auth.service';
import { HttpClient } from '@angular/common/http';
2017-11-07 16:06:17 +01:00
import { Component, OnInit, ElementRef, AfterViewInit, VERSION, Injectable } from '@angular/core';
2017-12-18 16:55:12 +01:00
import { Router, ActivatedRoute, Params } from "@angular/router";
import { SnackBarNotificationComponent } from "../../shared/components/notificaiton/snack-bar-notification.component";
import { MatPaginator, MatSort, MatSnackBar } from "@angular/material";
import { TranslateService } from "@ngx-translate/core";
2017-11-01 18:18:27 +01:00
declare const gapi: any;
2017-12-19 15:09:49 +01:00
declare const auth2 :any;
2017-11-01 18:18:27 +01:00
declare function simple_notifier(type: string, title: string, message:string): any;
@Component({
selector: 'googgle-sign-in',
templateUrl: './googgle-sign-in.component.html',
styleUrls: ['./googgle-sign-in.component.css']
})
2017-12-07 14:36:12 +01:00
export class GooggleSignInComponent implements OnInit, Injectable {
2017-11-01 18:18:27 +01:00
2017-12-18 16:55:12 +01:00
constructor(private element: ElementRef, private router : Router,private authService:AuthService,private route:ActivatedRoute,
public snackBar: MatSnackBar,public language: TranslateService
) { }
2017-11-01 18:18:27 +01:00
2017-12-07 14:36:12 +01:00
2017-11-01 18:18:27 +01:00
ngOnInit() {
2017-12-07 14:36:12 +01:00
this.initiateExternalProviders();
}
initiateExternalProviders(){
2017-12-18 16:55:12 +01:00
// if(gapi.auth2 == undefined){
2017-12-07 14:36:12 +01:00
2017-12-18 16:55:12 +01:00
// gapi.load('auth2', () => {
2017-12-07 14:36:12 +01:00
2017-12-18 16:55:12 +01:00
// this.auth2 = gapi.auth2.getAuthInstance({
// client_id: clientId,
// })
// });
2017-12-07 14:36:12 +01:00
2017-12-18 16:55:12 +01:00
// }else{
// this.auth2=gapi.auth2.getAuthInstance({
// client_id: clientId,
// })}
2017-11-23 14:57:47 +01:00
2017-11-07 16:06:17 +01:00
}
2017-11-07 15:03:51 +01:00
2017-11-01 18:18:27 +01:00
}