This repository was archived by the owner on Sep 8, 2020. It is now read-only.
This repository was archived by the owner on Sep 8, 2020. It is now read-only.
Cannot read property 'body' of undefined #311
Open
Description
Hi,
I'm having trouble with angular 1.6 integration with the error in title.
My usage is nothing special:
<input type="text" class="form-control" placeholder="comment" ui-tinymce="tinymceOptions"
ng-model="model.description">
I use a Service for share tinyMceOptions in various Controllers
Controller
...
$scope.tinymceOptions = tinyMceOptions;
....
Service
app.service('tinyMceOptions', ['ListProvider',function (ListProvider) {
return {
menubar:false,
plugins: [
'advlist autolink lists link image charmap print preview anchor',
'searchreplace visualblocks code fullscreen',
'insertdatetime media table contextmenu paste code','paste','autoresize','autolink',
'mention'
],
toolbar: 'undo redo | | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist | link',
valid_elements : "a[href|target=_blank],strong/b,div[align],br,li,ol,ul,i,em,p,span[id=autocomplete]",
fix_list_elements : true,
autoresize_bottom_margin: 4,
content_css: [
'/css/tinymce.css'
],
mentions: {
delimiter: ['@', '#'],
source: function (query, process, delimiter) {
// When using multiple delimiters you can alter the query depending on the delimiter used
if (delimiter === '@') {
//TODO angular better integration (insert function)
ListProvider.getList(null,null,'ecli')
.then(function(data) {
process(data);
});
}
if (delimiter === '#') {
ListProvider.getList(null,null,'fundamentalRights')
.then(function(data) {
process(data);
});
}
},
renderDropdown: function() {
return '<ul class="rte-autocomplete tinymce-autocomplete dropdown-menu"></ul>';
}
}};
}]);