Javascript 使用表情符号插件解决html绑定问题?

Javascript 使用表情符号插件解决html绑定问题?,javascript,html,angularjs,emoji,Javascript,Html,Angularjs,Emoji,我正在使用一个角度表情符号插件,它需要ngbindhtml。我正在使用这个表情符号插件来创建消息,但是我不希望它能够编译html代码,比如hello,但是使用表情符号插件必须使用ng绑定html。我有什么建议/方法可以绕过这一点,以便帖子将包含表情符号,而不是编译的html代码?谢谢 angular.module(“app”、[“dbaq.emoji”、“ngSanitize”]).controller(“AppCtrl”、函数($scope){ $scope.message=“动物::狗::

我正在使用一个角度表情符号插件,它需要
ngbindhtml
。我正在使用这个表情符号插件来创建消息,但是我不希望它能够编译html代码,比如
hello
,但是使用表情符号插件必须使用ng绑定html。我有什么建议/方法可以绕过这一点,以便帖子将包含表情符号,而不是编译的html代码?谢谢

angular.module(“app”、[“dbaq.emoji”、“ngSanitize”]).controller(“AppCtrl”、函数($scope){
$scope.message=“动物::狗::猫::蛇:人::微笑::困惑::愤怒:地方::房子::学校::酒店::大便:”;
});

试试我的简单解决方案: 1.创建文件html,如下所示:

<html>
<head>
    <meta charset="utf-8">
    <link rel="stylesheet" href="emoji.min.css">
    <script src="angular.js"></script>
    <script src="angular-sanitize.js"></script>
    <script src="emoji.min.js"></script><script src="script.js"></script>
</head>
<body ng-app="app" ng-controller="AppCtrl">

    <textarea ng-model="message"></textarea><div ng-bind-html="message | emoji"></div>
</body>
angular.module("app", ["emoji","ngSanitize"]).controller("AppCtrl", ['$scope', function ($scope) {
$scope.message = "Animals: :dog: :cat: :snake: People: :smile: :confused: :angry: Places: :house: :school: :hotel: :poop:";}]);

3.运行它。

您好,这个插件适合我。但是如果我不希望html代码运行,如果我使用输入字段并将其绑定到视图。例如,如果我输入hi,它将使字体变大。有没有一种方法可以在不编译html代码的情况下使用这个emoji插件,使用ng model='message'为我的自定义输入添加标记input/textarea,就像我上面使用textarea一样。我已经编辑了我的代码。。