나는 angularJS로 시작하고 내가 원하는 것은 tinymce-ui 텍스트 영역으로 폼을 제출하고 HTML 콘텐트와 텍스트 콘텐트를 제출하는 것이다.AngularJS 컨트롤러에서 TinyMCE 텍스트 콘텐트 얻기
지금은 tinyMce 텍스트 영역이 작동하고 있습니다. 내가 콘솔
tinyMCE.get('tinymce1').getBody().textContent
입력하면
<div> <form method="post"> <textarea ui-tinymce="tinymceOptions" ng-model="user.commentaireValue" id="tinymce1"></textarea> <textarea>{{user.commentaireValue}}</textarea> <textarea id="IwouldLikeNonHtmlContent">{{HELPME}}</textarea> </form> </div>
나는 내가 원하는 것을 얻을. 난 그냥 그렇게 할 수있는 방법 기능을 소독 사용하지 않고 내 컨트롤러
app.controller('UserCreationCtrl', ['$scope', 'UsersFactory', '$location', function ($scope, UsersFactory, $location) { // callback for ng-click 'createNewUser': $scope.createNewUser = function() { UsersFactory.create($scope.user); $location.path('/user-list'); }; $scope.options=[ {name:'black', shade:'dark'}, {name:'white', shade:'light'}, {name:'red', shade:'dark'}, {name:'blue', shade:'dark'}, {name:'yellow', shade:'light'} ]; $scope.correctlySelected = $scope.options[1]; $scope.tinymceOptions = { resize: false, width: 400, // I *think* its a number and not '400' string height: 300, plugins: 'textcolor link', toolbar: "undo redo styleselect bold italic forecolor backcolor", menu : { // this is the complete default configuration edit : {title : 'Edit' , items : 'undo redo | cut copy paste pastetext | selectall'}, insert : {title : 'Insert', items : 'link media | template hr'}, format : {title : 'Format', items : 'bold italic underline strikethrough superscript subscript | formats | removeformat'}, } }; //tinyMCE.get('tinymce1').getBody().textContent; }]);
에서 그것을 검색하는 방법을 알아낼 수 없습니다? Thnak.
이 설정 한'NG-model'에 의해 $ scope.user.commentaireValue''에 바인딩됩니다. – charlietfl