I apologize if this question seems redundant, but I have been unable to find a solution despite numerous similar inquiries. I am currently utilizing Angular and within the ngAfterViewInit() function, the following code is present:
gapi.load("auth2", () => console.log("test"))
. I have installed @types/gapi and @types/gapi.auth2 using npm. In my tsconfig.app.json file, I have included "gapi" and "gapi.auth2" in the types within compilerOptions. Additionally, I have placed <script src="https://apis.google.com/js/api.js"></script>
in the component's HTML file. I have attempted to import declare var gapi: any;
, but it did not resolve the issue. I also experimented with utilizing the triple slash directive /// <reference path="../../../node_modules/@types/gapi/index.d.ts">
or /// <reference types="gapi">
, without success. After conducting extensive research for hours, I am at a loss for what steps to take next. Any guidance would be greatly appreciated. Thank you.