I want to add an emoticon on click of emoticon inside an input text box.
Here is the text box:-
<input placeholder="Send message" submit-enter="sendMsg(chat.phone)" id="inputBoxFor{{chat.phone}}">
On click of Emo, this function gets started :-
$scope.addEmoticon=function(index){
$scope.trial = emoticonTexts[index].replace(emoticonRegex, function(match) {
return textToEmoticon[match]?'<div><img src="'+window.location.protocol+"//"+window.location.hostname+":"+window.location.port+"/"+emoticonDirPath+textToEmoticon[match]+'" class="emoticons_small"/></div>' : match;
});
return $scope.textInput[$scope.chatInFocus.phone]+=$scope.hemank;
};
What happens is this returns me the following inside the text box :-
<div><img src="http://localhost:9090//img/emoticons/emo_im_30_angry.png" class="emoticons_small"/></div><div><img src="http://localhost:9090//img/emoticons/emo_im_30_angry.png" class="emoticons_small"/></div>
I want the image to be shown.