ag-grid を実装したばかりですが、内部でコンパイルされた角度のあるテンプレートで cellTemplates を使用すると IE9 がクラッシュすることがわかりました。
これに遭遇し、回避策を見つけた人はいますか?
再現方法:
ここ ( http://www.ag-grid.com/angular-grid-cell-template/index.php ) に IE でアクセスし、DevTools から IE9 を選択します。
angular コンパイルされたテンプレートが原因でクラッシュします。私がそれについて何ができるかわからない。
(これについても GitHub で問題を開きました: https://github.com/ceolter/ag-grid/issues/521 )
編集:
それをデバッグすると、あるメソッドからの配列への更新が何らかの形で別のメソッドに表示されないため、無限ループが発生します...
無限ループは次のとおりです: getTemplate、(呼び出しが終了するまで待機)、呼び出しの終了、テンプレートのキャッシュへの追加、コールバックの実行、コールバックは templateCache 内のテンプレートを参照せず、別のコールバックの作成、キューへの追加などの上。(以下の ag-grid のコード)。
// returns the template if it is loaded, or null if it is not loaded
// but will call the callback when it is loaded
TemplateService.prototype.getTemplate = function (url, callback) {
var templateFromCache = this.templateCache[url];
if (templateFromCache) {
return templateFromCache;
}
var callbackList = this.waitingCallbacks[url];
var that = this;
if (!callbackList) {
// first time this was called, so need a new list for callbacks
callbackList = [];
this.waitingCallbacks[url] = callbackList;
// and also need to do the http request
var client = new XMLHttpRequest();
client.onload = function () {
that.handleHttpResult(this, url);
};
client.open("GET", url);
client.send();
}
// add this callback
if (callback) {
callbackList.push(callback);
}
// caller needs to wait for template to load, so return null
return null;
};
TemplateService.prototype.handleHttpResult = function (httpResult, url) {
if (httpResult.status !== 200 || httpResult.response === null) {
console.warn('Unable to get template error ' + httpResult.status + ' - ' + url);
return;
}
// response success, so process it
this.templateCache[url] = httpResult.response;
// inform all listeners that this is now in the cache
var callbacks = this.waitingCallbacks[url];
for (var i = 0; i < callbacks.length; i++) {
var callback = callbacks[i];
// we could pass the callback the response, however we know the client of this code
// is the cell renderer, and it passes the 'cellRefresh' method in as the callback
// which doesn't take any parameters.
callback();
}
if (this.$scope) {
var that = this;
setTimeout(function () {
that.$scope.$apply();
}, 0);
}
};
return TemplateService;
})();