我知道以前曾在这里问过这个问题,但是没有一个解决方案对我有用。我有以下tsconfig:
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"declaration": true,
"outDir": "./dist"
},
"typeRoots": ["./node_modules/@types/*"],
"include": [
"./src/**/*"
]
}
Run Code Online (Sandbox Code Playgroud)
但是当我跑步时tsc我得到:
../node_modules/@types/passport/index.d.ts(100,5): error TS2300: Duplicate identifier 'export='.
node_modules/@types/passport/index.d.ts(100,5): error TS2300: Duplicate identifier 'export='.
Run Code Online (Sandbox Code Playgroud)
../node_modules/@types/ (etc)当我明确地说仅包括./src文件夹和仅来自类型时,我仍如何得到./node_modules/@types?
我正在使用2.4.0版的打字稿(但与2.3.4版有相同的问题)
尝试部署到谷歌云功能时,我得到了响应
load error: File ./dist/index.js that is expected to define function doesn't exist
Run Code Online (Sandbox Code Playgroud)
这是为什么?
在Angular 2的文档中写道:
当我们可以编写一个简单的绑定时,为什么要创建一个处理单击的指令?
<button (click)="onSave()">Save</button>
如果这不是指令,那么它是什么?他们称之为"简单绑定",这与指令有何不同?我的意思是它仍然是由Angular特别处理的东西,那么他们为什么如此自豪呢?(click)而不是ng-click像Angular 1那样?
我有一个AMP页面,其中包含Google跟踪代码管理器(GTM)。现在,我创建了一个“通用点击”标记,该标记应该将每次点击记录到Google Analytics(分析)中。
在开发控制台中看起来不错:
请求被发送到URL:https : //www.google-analytics.com/collect?v=1&_v=a0&ds=AMP&aip=true&_s=3&dt=TypeScript%20MEAN&sr=1440x900&_utmht=1502735532566&cid=amp-2_4H1svvoL5wMZhnu8KNXK1KY1KY3KW1KW3KW1KW3KW1K1WK1WK1WK1WK1WK1KYK1WK1WK1WK1WK1W1美国国贸联盟4&dl = https%3A%2F%2Fwww.tsmean.com%2F&dr =&sd = 24&ul = en-gb&de = UTF-8&jid =&t = event&ec = https%3A%2F%2Fwww.tsmean.com%2F&ea = click&el = 9&ev = &a = 2321&z = 0.08240769669002734
它似乎包含所有重要的查询参数:
但是,在Google Analytics(分析)实时事件中,只有我也混淆了的“滚动事件”才会显示,而点击事件却一无所获:
有谁知道可能是什么问题?