So, what do i have:
- Text that contains smiles like
:)
:(
:\
- A filter that replace smiles with
img
tag DIV
with{{ message | smiles }}
Like you know, the {{}}
converts all html tags to html entities.
So i get: Message that contains smile <img src="/smile.gif">
I tried to use ng-bind-html
and $sanitize
, but it's do not sanitaize "good" html tags like <b>
, <a>
, etc...
I want to apply my smiles
filter AFTER that message
variable be sanitized. And i dont know how to do that.
EDIT1:
message
variable contains "here message with smiles :) :( :\
"
Filter that converts 'smiles' to img
tag:
angular.module('my.filters', [])
.filter('smiles', function () {
return function (input) {
return input.replace(/:\)/gi, '<img src="/images/smile.gif">');
}
});
The DIV
element:
<div>{{ message | smiles}}</div>
When it's rendered i get:
here message with smiles <img src="/images/smile.gif">
and not here message with smiles