Angular 表单在 Internet Explorer 11 中不工作
Angular Form not working in Internet Explorer 11
我开发了一个 Angular 6 项目。在 Chrome、Mozilla 和 Apple 浏览器中一切正常,但在 Internet Explorer 11 中无法正常工作。我无法在单击按钮时保存数据。
在控制台(网络)中,单击按钮时,它不会调用 API。
我需要在 IE11 的 angular TS 文件中进行任何特殊导入吗?
转到您的 polyfills.ts
文件并找到在 /** IE9, IE10 and IE11 requires all of the following polyfills. */
:
部分下注释掉的导入语句
// import 'classlist.js'; // Run `npm install --save classlist.js`.
取消注释上述导入以使您的应用程序与这些 IE 浏览器一起工作,但不要忘记运行以下命令。
npm install --save classlist.js
您可能还需要取消注释以下导入:
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.
并且不要忘记 运行 以下命令:
npm install --save web-animations-js
编辑
在browserslist
文件中,您可以将not IE 9-11
替换为IE 9-11
。
此外,在 tsconfig.json
文件中,您可以将 "target": "es2015"
(或其他)替换为 "target": "es5"
。
您的问题包含的信息不足,无法给出实际答案。但是,IE11+form 过去给我带来了一些麻烦。
在我的例子中,我必须将 type='submit'
添加到提交按钮,将 type='button'
添加到所有其他按钮。
在 angular 网站上明确写明不支持 Internet Explorer 11,您必须使用此 [=17= 的自述文件中编写的以下步骤配置您的 angular 项目] 页。
我开发了一个 Angular 6 项目。在 Chrome、Mozilla 和 Apple 浏览器中一切正常,但在 Internet Explorer 11 中无法正常工作。我无法在单击按钮时保存数据。
在控制台(网络)中,单击按钮时,它不会调用 API。
我需要在 IE11 的 angular TS 文件中进行任何特殊导入吗?
转到您的 polyfills.ts
文件并找到在 /** IE9, IE10 and IE11 requires all of the following polyfills. */
:
// import 'classlist.js'; // Run `npm install --save classlist.js`.
取消注释上述导入以使您的应用程序与这些 IE 浏览器一起工作,但不要忘记运行以下命令。
npm install --save classlist.js
您可能还需要取消注释以下导入:
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.
并且不要忘记 运行 以下命令:
npm install --save web-animations-js
编辑
在browserslist
文件中,您可以将not IE 9-11
替换为IE 9-11
。
此外,在 tsconfig.json
文件中,您可以将 "target": "es2015"
(或其他)替换为 "target": "es5"
。
您的问题包含的信息不足,无法给出实际答案。但是,IE11+form 过去给我带来了一些麻烦。
在我的例子中,我必须将 type='submit'
添加到提交按钮,将 type='button'
添加到所有其他按钮。
在 angular 网站上明确写明不支持 Internet Explorer 11,您必须使用此 [=17= 的自述文件中编写的以下步骤配置您的 angular 项目] 页。