Add empty WebAPI project

This commit is contained in:
2022-11-29 21:25:19 +01:00
parent 48bd1e93a4
commit 7d639ba238
11 changed files with 174 additions and 2 deletions

View File

@@ -1,3 +1,4 @@
import { OnInit } from '@angular/core';
import { Component, ViewChild } from '@angular/core';
import { MatSidenav } from '@angular/material/sidenav';
import * as moment from 'moment';
@@ -10,7 +11,7 @@ import { DeviceService } from '../services/device.service';
templateUrl: './main-view.component.html',
styleUrls: ['./main-view.component.scss']
})
export class MainViewComponent {
export class MainViewComponent implements OnInit {
@ViewChild('snav') snav?: MatSidenav;
appVersion = packageInfo.version;
@@ -24,7 +25,31 @@ export class MainViewComponent {
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();