我以某种方式需要捕获方法来捕获触发的事件,但是模板中的 ($event) 默认是在冒泡方法中触发的。有什么地方可以改变吗?
我最近学习使用system.js导入由Typescript编译的模块.这些模块以前是为require.js编译的,工作正常.
但是,在合并到system.js时,在应用system-production.js时无法导入模块.控制台说
Uncaught (in promise) Error: Module instantiation did not call an anonymous or correctly named System.register.
Instantiating https://www.star.com/libs/js/klondike.js
Loading ./libs/js/klondike.js
at register-loader.js:203
t @ common.js:83
(anonymous) @ loader-polyfill.js:70
Run Code Online (Sandbox Code Playgroud)
我不太明白是什么原因导致错误消息.当我应用system.src.js时,不会有错误消息,但我不能在导入的模块中使用函数.任何调用都将返回undefined.那么我的运作方式是否错误?
以下是源代码.
的test.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
</body>
<!-- sys import -->
<script src="libs/js/system-production.js"></script>
<!--<script src="libs/js/system.src.js"></script>-->
<script>
System.import("./libs/js/klondike.js");
</script>
</html>
Run Code Online (Sandbox Code Playgroud)
tsconfig.json
{
"compilerOptions": {
"module": "System",
"outFile": "../../js/klondike.js",
"target": "es5",
"sourceMap": true,
"removeComments": true
},
"include": [
"./*"
]
}
Run Code Online (Sandbox Code Playgroud)
主要模块:CardMoves.ts …