【发布时间】:2019-02-11 16:33:32
【问题描述】:
在我的 Angular 7 解决方案中,我遇到了 Microsoft Edge 视图中的数据绑定问题/Opera、Chrome 和 Mozilla 等其他浏览器工作正常/。 我的页面包含多个输入元素,如文本框、下拉菜单、单选按钮、日期选择器。每个输入元素上都有 onValueChange 触发器,在控制器 /.ts 文件/中,这些更改是立即的,但视图没有更新。
我添加了双花括号表示法来显示视图中的当前值,但值是空值/或旧值/直到您单击下一个输入/但不是每个输入 - 仅日期选择器或下拉/。 当我尝试在其他浏览器中检查时,在输入值后立即显示值。
我尝试为支持的浏览器添加多个基于 angular 官方网站的 polyfill,但没有任何帮助。
这是我的 tsconfig.json 和 polyfills.ts:
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"importHelpers": true,
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"module": "es2015",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es2015",
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2017",
"dom"
]
}
}
/** IE9, IE10 and IE11 requires all of the following polyfills. **/
import 'core-js/es6/symbol';
import 'core-js/es6/object';
import 'core-js/es6/function';
import 'core-js/es6/parse-int';
import 'core-js/es6/parse-float';
import 'core-js/es6/number';
import 'core-js/es6/math';
import 'core-js/es6/string';
import 'core-js/es6/date';
import 'core-js/es6/array';
import 'core-js/es6/regexp';
import 'core-js/es6/map';
import 'core-js/es6/weak-map';
import 'core-js/es6/set';
/** IE10 and IE11 requires the following for the Reflect API. */
import 'core-js/es6/reflect';
// Used for browsers without a native support of Custom Elements
import '@webcomponents/custom-elements/custom-elements.min';
import '@ng-select/ng-select/bundles/ng-select.umd.min';
import 'web-animations-js'; // run `npm install --save web-animations-js`.
有什么方法可以让它在 Edge 上运行吗?
【问题讨论】:
-
欢迎来到 Stack Overflow!请务必分享相关代码。如果可能的话,分享一个工作的和最小的代码 sn-p 来演示这个问题。
标签: angular internet-explorer cross-browser microsoft-edge angular-elements