After Baidu, I set the value of app.config in appmodule $compileProvider.imgSrcSanitizationWhitelist(/^s*(https?|local|data):/);
But it had no effect
I would like to ask if there are any other ways to remove this unsafe
html code: <p class="user_pic"><img src="{{item.UserID | imgSrc}}" width="100%;" height="178px;"></ p>
In controller: app.filter('imgSrc', function () {
return function (input) {
var src = '';
if (input == undefined) {
return;
}
$.ajax({
url: BaseURL + "/MainUser/LoadUserPersonalHomepageByUseriD?userID=" + input,
type: 'get',
async: false,
success: function (data) {
if (data.UploadIMG == null) {
src = '/img/tp.png'
} else {
src = data.UploadIMG
}
}
})
return src;
}
});