I'm beggining with angularJS and what I want is to submit a form with an tinymce-ui textarea and submit both the HTML content and text content.
For now I have the tinyMce textarea working.
<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>
If I type in the console
tinyMCE.get('tinymce1').getBody().textContent
I get what I want. I just can't figure out how to retrieve it in my controller
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; }]);
How can I do that without using sanitize function ? Thnak you.