import { OnInit } from '@angular/core'; import { Component, ViewChild } from '@angular/core'; import { MatSidenav } from '@angular/material/sidenav'; import * as moment from 'moment'; import packageInfo from 'package.json'; import { DataService } from '../services/data.service'; import { DeviceService } from '../services/device.service'; @Component({ selector: 'app-main-view', templateUrl: './main-view.component.html', styleUrls: ['./main-view.component.scss'] }) export class MainViewComponent implements OnInit { @ViewChild('snav') snav?: MatSidenav; appVersion = packageInfo.version; submenus = { administration: false, }; currentDate = moment().toDate(); flipPhone: boolean = false; loading: boolean = false; constructor( public _data: DataService, public _device: DeviceService ) { } ngOnInit(): void { // @ts-ignore google.accounts.id.initialize({ client_id: "107631825312-bkfe438ehr9k9ecb2h76g802tj6advma.apps.googleusercontent.com", callback: this.handleCredentialResponse.bind(this), auto_select: false, cancel_on_tap_outside: true, }); // @ts-ignore google.accounts.id.renderButton( // @ts-ignore document.getElementById("google-button"), { theme: "outline", size: "large", width: "100%" } ); // @ts-ignore google.accounts.id.prompt((notification: PromptMomentNotification) => { }); } async handleCredentialResponse(response: any) { // Here will be your response from Google. console.log(response); } reloadApp() { document.location.reload(); } logout() { } }