<input ng-model="test" placeholder="pre" type="text" title="PROJECT>" />
The above code for tooltip displays "PROJECT>". But what I need is to display the text as is "PROJECT>"
Is there a way to do this? I'm using angular.
You need to use the encoded string in the title. You can use online tools such as this one to do this.
<input ng-model="test" placeholder="pre" type="text" title="PROJECT&GT" />
you can try something like this: create angular filter :
angular.module('ppvApp.event').filter('escapeHtml', function() {
var charMap= {
"&": "&",
"<": "<",
">": ">",
'"': '"',
"'": ''',
"/": '/'
};
return function(str) {
return String(str).replace(/[&<>"'\/]/g, function(s) {
return charMap[s];
});
}
});
and then use it as:
<input ng-model="test" placeholder="pre" type="text" title="{{'PROJECT>' | escapeHtml}}" />
One way to go is to separate the &
from the GT
(or any other similar entity) with a 
which is a Zero Width No-Break Space ( http://www.codetable.net/hex/feff ), like this:
<input ng-model="test" placeholder="pre" type="text" title="PROJECT&GT" />
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.