lemonde / angular-ckeditor

CKEditor directive for Angular.
137 stars 133 forks source link

Not adding Mention Plugin #80

Open vikasvyas47 opened 5 years ago

vikasvyas47 commented 5 years ago

hello

i tried to add mention plugin in angularjs ckeditor but it's not working and there is no help as well for angularjs can you please guide me

gpurbia commented 5 years ago

Can you post your code or create plunker for that what you have tried ?

vikasvyas47 commented 5 years ago

i used following code :

$scope.options = 
   {
       language       : 'en',
       allowedContent : true,
       entities       : false,
       removeButtons  : 'About,Form,Checkbox,Radio,TextField,Textarea,Select,Button,HiddenField,Save,CreateDiv,Language,BidiLtr,BidiRtl,Flash,Iframe,addFile,Styles,NewPage,Preview,Replace,SpellChecker,Print,Templates,Cut,Copy,Paste,Undo,Redo,Subscript,Superscript,RemoveFormat,TextColor,BackgroundColor,ShowBlocks,Anchor,pastefromword,ImageButton,Outdent,Indent,HorizontalRule,SpecialChar,Font,FontSize,BGColor,TextColor,SelectAll,PasteText,Find,PasteFromWord,Table,PageBreak,Strike,Blockquote,Image,Maximize,Smiley',
       extraPlugins   : 'imgbrowse,videodetector,emojione,wsc,mentions',/**/
       'mentions'       : [{
                            feed: function( options, callback ) {
                                var xhr = new XMLHttpRequest();

                                xhr.onreadystatechange = function() {
                                    if ( xhr.readyState == 4 ) {
                                        if ( xhr.status == 200 ) {
                                            callback( JSON.parse( this.responseText ) );
                                        } else {
                                            callback( [] );
                                        }
                                    }
                                }

                                xhr.open( 'GET', '/users?name=' + encodeURIComponent( options.query ) );
                                xhr.send();
                            }
                        }]

   };
gpurbia commented 5 years ago

Show me the HTML code also.

vikasvyas47 commented 5 years ago

here is my html code <textarea ckeditor="options" ng-model="npost.fldmessages" id="chartss" name="chartss"></textarea>

vikasvyas47 commented 5 years ago

did you find any solution @gpurbia ?

gpurbia commented 5 years ago

Not sure, make sure that you have properly insert all 3 required script and check console if you are getting any error. Check this scripts are proper included or not. If possible create plunker with your code.

vikasvyas47 commented 5 years ago

i already added these scripts

gpurbia commented 5 years ago

check this plunker i have created with the properties you mentions above. https://plnkr.co/edit/5nghwGTkMLIuXP79Wkox?p=preview

vikasvyas47 commented 5 years ago

i have checked but how it will work i did same thing

gpurbia commented 5 years ago

Check console errors, may be some scripts or plugins are included properly.Comment extraPlugins line and then try.

vikasvyas47 commented 5 years ago

but how can i add plugins file of ckeditor here ?