我在尝试显示一些很棒的字体图标时遇到了一点麻烦。我有一些文本是通过rakefile用json编写的,我正试图在文本中加入一个很棒的字体图标,但由于文本是用json编写的,所以遇到了麻烦,我想知道是否有人可以快速查看一下并帮助我解决问题。图标没有显示,但是在开发工具中,它应该出现的地方有额外的空白区域。
我使用的是haml,前端是angular。我不认为我需要向控制器展示这个。我还做了我和迪兹坚果的对比。
我rakefile中的区域是这样的
{
"partial":"message",
"params":{
"primary": true,
"icon": "<i class='fa fa-odnoklassniki'></i>",
"body":" With Deez Nuts as your president, you can have the full assurance of knowing that your country will be awesome "
}
},应该渲染这个的haml文件在这里。
%div{ 'ng-if' => 'option.params.primary' && 'option.params.icon'}
%div{ 'ng-include' => "'/assets/ng/features/politicians/satire/presidents.html'" }发布于 2015-09-15 06:48:26
您的html可能已被angular剥离。检查输出以确保。您可以将此筛选器添加到您的应用程序中以呈现受信任的html:
.filter('trustedHtml', ['$sce', function($sce){
return function(text) {
return $sce.trustAsHtml(text);
};
}])然后您可以将其应用于任何数据:{{foo | trustedHtml}}
https://stackoverflow.com/questions/32575036
复制相似问题