我已经成功地构建并部署了我的 Angular 组件到 ASP.NET 网站上。
但问题是,如果我将代码粘贴在 body 标签下,它可以正常工作。但如果我把它粘贴在 form 标签内,它就无法正常工作。
因此,在 main.master 中这样做是有效的:
<body>
<app-root>testtt</app-root>
<script type="text/javascript" src="/scripts/inline.bundle.js"></script>
<script type="text/javascript" src="/scripts/polyfills.bundle.js"></script>
<script type="text/javascript" src="/styles.bundle.js"></script>
<script type="text/javascript" src="/scripts/vendor.bundle.js"></script>
<script type="text/javascript" src="/scripts/main.bundle.js"></script>
但是,如果我将此代码复制到使用此主页面的另一个网页中,则无法正常工作,并且在控制台中看到以下日志。
Uncaught Error: Sys.ParameterCountException: Parameter count mismatch.
at Function.Error$create [as create] (ScriptResource.axd?d=3YJmGXxjI2IKNjUZL30bBbVBGOzpviJQaJ0A9mxA_CXR8fTNHpjVjDF4vyz3OkxXRfN4mDos_e1vdt…:237)
at Function.Error$parameterCount [as parameterCount] (ScriptResource.axd?d=3YJmGXxjI2IKNjUZL30bBbVBGOzpviJQaJ0A9mxA_CXR8fTNHpjVjDF4vyz3OkxXRfN4mDos_e1vdt…:413)
at Function$_validateParameterCount [as _validateParameterCount] (ScriptResource.axd?d=3YJmGXxjI2IKNjUZL30bBbVBGOzpviJQaJ0A9mxA_CXR8fTNHpjVjDF4vyz3OkxXRfN4mDos_e1vdt…:118)
at Function$_validateParams [as _validateParams] (ScriptResource.axd?d=3YJmGXxjI2IKNjUZL30bBbVBGOzpviJQaJ0A9mxA_CXR8fTNHpjVjDF4vyz3OkxXRfN4mDos_e1vdt…:70)
at String$startsWith (ScriptResource.axd?d=3YJmGXxjI2IKNjUZL30bBbVBGOzpviJQaJ0A9mxA_CXR8fTNHpjVjDF4vyz3OkxXRfN4mDos_e1vdt…:491)
at String.startsWith (polyfills.bundle.js:5199)
at new Sys$UI$DomEvent (ScriptResource.axd?d=3YJmGXxjI2IKNjUZL30bBbVBGOzpviJQaJ0A9mxA_CXR8fTNHpjVjDF4vyz3OkxXRfN4mDos_e1vdt…:3986)
at browserHandler (ScriptResource.axd?d=3YJmGXxjI2IKNjUZL30bBbVBGOzpviJQaJ0A9mxA_CXR8fTNHpjVjDF4vyz3OkxXRfN4mDos_e1vdt…:4052)