我正在为我的Angular应用程序设置服务器端渲染。我按照这个article中的步骤操作,并运行命令来启动应用程序。我收到了由特定于浏览器的对象(如window或document )引起的document is not defined。我发现这个错误是由于index.html中的谷歌分析网站标签造成的。<script async src="https://www.googletagmanager.com/gtag/js?{
dataLayer.push(a
当我试图导入外部模块和尝试编译我的代码时,会出现以下错误消息:app.ts:1 Uncaught ReferenceError: require is not defined at app.ts:1。打字本为: 2.1.6。import {PI, calcCircumference } from "./math/circle";
console.log(calcCircumference(10));我的circle.ts文件
export const PI: number = 3.
我想发送任何用户输入的数据从<form />提交到谷歌分析,这样我就可以做一些事情,如看到最常用的搜索词等。我熟悉发送事件,但不确定如何包括任何用户数据的方式,他们是正确解析的GA,并可以过滤/排序/分析。HTML将如下所示:// I use Vue but any vanilla JS solution would work})(window,document,'scri