Angularjs bootstrap-wysihtml5 Angular指令未在更改时正确更新

Angularjs bootstrap-wysihtml5 Angular指令未在更改时正确更新,angularjs,wysihtml5,Angularjs,Wysihtml5,我目前正在尝试将wysihtml5与Angular指令一起使用,但似乎无法正确启动更改事件 以下是我设置的指令: app.directive('wysiwyg', ['$parse', function() { return { restrict: "A", require: "?ngModel", link: function(scope, element, attrs, ctrl) { var change = function() {

我目前正在尝试将wysihtml5与Angular指令一起使用,但似乎无法正确启动更改事件

以下是我设置的指令:

app.directive('wysiwyg', ['$parse', function() {
 return {
    restrict: "A",
    require: "?ngModel",
    link: function(scope, element, attrs, ctrl) {

        var change = function() {
            scope.$apply(function(){
                ctrl.$setViewValue($(element).val());
            });
        };

        $(element).wysihtml5({
            "font-styles": true, //Font styling, e.g. h1, h2, etc. Default true
            "emphasis": true, //Italics, bold, etc. Default true
            "lists": true, //(Un)ordered lists, e.g. Bullets, Numbers. Default true
            "html": false, //Button which allows you to edit the generated HTML. Default false
            "link": true, //Button to insert a link. Default true
            "image": true, //Button to insert an image. Default true,
            "color": false, //Button to change color of font
            "events": {
                "change": function() {
                    window.console.log("changed");
                    change();
                },
                "newword:composer": function() {
                    change();
                },
                "paste": function() {
                    change();
                }
            }
        });
    }
 };
}]);

根据wysihtml5的文档,这就是您如何聆听变更元素的方式。但是,它当前仅在模糊时触发,而不是在对编辑器进行更改时触发。我是否应该寻找一个不同的事件,或者我应该使用角度指令以不同的方式进行此操作?

您是否尝试过此指令?