无法检索tinyMCE值的ng-model值

时间:2017-09-25 07:22:48

标签: angularjs asp.net-mvc

我正在尝试从ng-model angular JS中检索富文本框tinyMCE值。但我得到的价值是未定义的。 以下是我在MVC中的HTML代码:

<div class="form-group">
        @Html.LabelFor(model => model.QDescription, htmlAttributes: new { @class = "control-label col-md-2" })
        <div class="col-md-10">
            @*<textarea ui-tinymce ng-model="tinymceModel"></textarea>*@
            @*@Html.EditorFor(model => model.QDescription, new { htmlAttributes = new { @class = "form-control", ng_model = "QDescription" } })*@
            @Html.TextAreaFor(model => model.QDescription, new { htmlAttributes = new { @class = "form-control", ng_model = "QDescription" } })
            @Html.ValidationMessageFor(model => model.QDescription, "", new { @class = "text-danger" })            

        </div>

        <div>
            <div text-angular ng-model="htmlContent" name="demo-editor" ta-text-editor-class="border-around" ta-html-editor-class="border-around"></div>
        </div>
    </div>

以下是我的角度控制器的代码:

angular.controller('PostQuestion', function ($scope, $http) {  
//Insert Question
$scope.saveQuestion = function () {
    tinyMCE.triggerSave(true, true);
    $scope.PostQuestion = {};
    $scope.PostQuestion.QTitle = $scope.QTitle;
    $scope.PostQuestion.QDescription = $scope.QDescription;        

    alert($scope.QDescription);
    debugger;
    $http({
        method: 'POST',
        url: '/PostQuestion/InsertQuestion',
        data: JSON.stringify($scope.PostQuestion)
    }).success(function () {
        //GetAllData();
        $scope.empModel = null;
        alert("Employee Added Successfully!!!");
    }).error(function () {
        alert(data.errors);
    });
    GetAllData();
};  

});

总是获得$ scope.QDescription仅是未定义的。

0 个答案:

没有答案
相关问题