我正在使用带有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; }
});