Angular ng-bind-html 表情符号插件有问题?

Angular ng-bind-html issue with emoji plugin?

我正在使用需要 ng-bind-html 的 angular 表情符号插件。我正在使用这个表情符号插件来创建消息,但是我不想要它以便可以编译 html 代码,例如 <h2>hello</h2>,但是必须使用 ng-bind-html表情符号插件。任何 suggestions/ways 我可以解决这个问题,以便帖子将包含表情符号而不是 html 编译的代码?谢谢

angular.module("app", ["dbaq.emoji","ngSanitize"]).controller("AppCtrl", function ($scope) {
    $scope.message = "Animals: :dog: :cat: :snake: People: :smile: :confused: :angry: Places: :house: :school: :hotel: :poop:";
});
<html>
    <head>
        <meta charset="utf-8">
        <link rel="stylesheet" href="emoji.min.css">
        <script src="angular.min.js"></script>
        <script src="emoji.min.js"></script>
    </head>
    <body ng-app="app" ng-controller="AppCtrl">
        <div ng-bind-html="message | emoji"></div>
    </body>
</html>

表情插件 --> https://github.com/dbaq/angular-emoji-filter-hd

试试我的简单解决方案: 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-sanitize.js 的文件 js。复制 here 并另存为 angular-sanitize.js。然后其他文件 'emoji.min.css, angular.js & emoji.min.js' 存在于您的应用程序中。也请注意你的路径。

2.Create js 文件调用 script.js 像这样:

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.Run吧。