我得到一些数据,然后尝试编译它然后"信任"将内容作为HTML,然后将数据分配给scope.model
,但出于某种原因,我对此大吼:Attempted to trust a non-string value in a content requiring a string: Context: html
if (response.data) {
var trustedData = $sce.trustAsHtml(response.data.PostContent);
scope.model.postContent = $compile(trustedData);
}