Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/cocoa/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angularjs 在模态中使用角度trix时绑定不起作用_Angularjs_Twitter Bootstrap - Fatal编程技术网

Angularjs 在模态中使用角度trix时绑定不起作用

Angularjs 在模态中使用角度trix时绑定不起作用,angularjs,twitter-bootstrap,Angularjs,Twitter Bootstrap,我用的是角三角形。 我启动了一个模式(引导),但绑定不起作用 如果我将绑定放在div中,我可以看到它被传递到modal中,但是对于角度trix组件,它不会出现 我的代码是: $scope.editCommentDialog = function (comment) { var modalInstance = $modal.open({ templateUrl: 'editCommentDialog.html',

我用的是角三角形。 我启动了一个模式(引导),但绑定不起作用

如果我将绑定放在div中,我可以看到它被传递到modal中,但是对于角度trix组件,它不会出现

我的代码是:

         $scope.editCommentDialog = function (comment) {
            var modalInstance = $modal.open({
                templateUrl: 'editCommentDialog.html',
                windowClass : 'edit-comment-modal-dialog',
                controller: function ($scope, $modalInstance, editedComment) {
                    $scope.editedComment = editedComment;

                    $scope.ok = function () {
                        $modalInstance.close(editedComment);
                    };

                    $scope.cancel = function () {
                        $modalInstance.dismiss('cancel');
                    };
                },
                resolve: {
                    editedComment: function () {
                       return { id : comment.id,  text : comment.text};
                    }
                }
            });

            modalInstance.result.then(function (editedComment) {
                $scope.editedComment = editedComment;
                $scope.updateComment();
            }, function () {
                $log.info('Modal dismissed at: ' + new Date());
            });
        };


编辑
好啊
取消

将ng if=“true”添加到代码中,使其看起来像:

<trix-editor ng-if="true" angular-trix ng-model="editedComment.text" class="trix-content editable-trix-editor"></trix-editor>


它解决了问题

如果删除
$scope.editedComment=editedComment形成您的
。然后
回调?我删除了它,但仍然没有绑定。有人在这方面运气好吗?
<trix-editor angular-trix ng-model="editedComment.text" class="trix-content editable-trix-editor"></trix-editor>
<trix-editor ng-if="true" angular-trix ng-model="editedComment.text" class="trix-content editable-trix-editor"></trix-editor>