如何使用HAndsOnTable和Angular 1.4.8与IE11一起使用JSFiddle?我收到这个错误:
Object不支持属性或方法'endsWith'
我不确定,但我认为罪魁祸首就是这条线:
$scope.$apply();
答案 0 :(得分:1)
我修复了你的fiddle,我还修复了IE11错误。请注意,.endWith()
不是IE中的有效功能。一旦你将这个功能添加为原型,你就可以了:
if (!String.prototype.endsWith) {
String.prototype.endsWith = function(searchString, position) {
var subjectString = this.toString();
if (typeof position !== 'number' || !isFinite(position) || Math.floor(position) !== position || position > subjectString.length) {
position = subjectString.length;
}
position -= searchString.length;
var lastIndex = subjectString.indexOf(searchString, position);
return lastIndex !== -1 && lastIndex === position;
};
}
(摘自https://www.sitepoint.com/community/t/endswith-issue-in-ie11/233838)