我正在使用带有anular js的select2来显示带有图像的下拉列表,我正在实现它以在页面加载的第一次显示它,
之后,当我导航到另一个页面并返回到同一页面图像未显示时,我没有发现我的代码出了什么问题
谁能帮我找到解决方案
这是我的代码
function format1(operator) {
if (!operator.id) return operator.text;
var data = angular.fromJson(operator.id);
var name = data.countryIsoAlpha3Code.toLowerCase();
if(name.length>0)
return "<label><img src='/static/img/flags/"+name+"_flag.png'/> " + operator.text+"</label>";
}
$("#e3").select2({
formatResult: format1,
formatSelection: format1,
escapeMarkup: function(m) { return m; }
});