We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

ERROR TypeError: this.toolbarModule.enableDisableInsertComment is not a function

Dear Sir,

I am using Document Editor in my Angular 8 project.

When I build it in development mode it works fine.

But during production build it throws error - "ERROR TypeError: this.toolbarModule.enableDisableInsertComment is not a function".

Can you please look into this error and guide me what am I doing wrong ??

Best Regards,
Ankit Pathak



3 Replies

HC Harini Chellappa Syncfusion Team January 8, 2020 05:22 AM UTC

Hi Ankit, 

We have created Angular CLI sample which is provided in getting started with angular version 8.3. Checked it in production mode. We couldn’t able to reproduce the reported issue.  

Can you please share below configuration details in your side or provide simple sample to reproduce the issue? that will helpful for us to investigate further and provide you solution at earliest. 

·       Angular version 
·       Target version in tsconfig.json file 
·       Production configuration details 
 
In mean time, confirm you have updated source file. 

Regards,  
Harini C


SK Santhosh Kumar Kaleru June 5, 2021 07:20 AM UTC

Hi Ankith
We need an option to disable Edit, Delete, Resolve options in comments pane as different users can add comments to same document.
We want to enable Edit, Delete, Reply, Resolve options to the comment owner only.
Kindly provide  some suggestions if you have 
Thanks in advance.

Santhosh Kumar K.




KB Kurthis Banu Abdul Majeeth Syncfusion Team June 7, 2021 05:16 AM UTC

Hi Santhosh, 

You can achieve your requirement based on current user. Kindly refer the below code snippet for your reference. 

Code snippet: 
 
 this.container.documentEditor.currentUser= 'Nancy Davolio'; 
 

Documentation link: 


Regarding:  Disable Delete, Edit, Resolve options in comments pane comments 

you can use “beforeCommentAction” to prevent the comments action based on your requirement. 


// you can modify the type based on your requirements 
Note: CommentAction = 'Delete' | 'Reply'| 'Edit' | 'Resolve' | 'Reopen' | 'Post'; 

Code snippet:  
 
beforeCommentAction(args: CommentActionEventArgs): void { 
 
        if (args. author !== this.container.documentEditor.currentUser) { 
            args.type = 'Edit';    // you can modify the type based on your requirements  
            args.cancel = true; 
 
             
            DialogUtility.alert({ 
 
                title: 'Information', 
 
                content: 'Edit restriction enabled. Only the author of the comment can delete it.', 
 
                showCloseIcon: true, 
 
                closeOnEscape: true, 
 
            }); 
 
        } 
 
    } 
 


Regarding: Comment Delete  


you can use “commentDelete” event to prevent deletion.  

Code snippet: 
 
commentDelete(args: CommentDeleteEventArgs): void { 
        if (args. author !== this.container.documentEditor.currentUser) { 
 
            args.cancel = true; 
 
            DialogUtility.alert({ 
 
                title: 'Information', 
 
                content: 'Delete restriction enabled. Only the author of the comment can delete it.', 
 
                showCloseIcon: true, 
 
                closeOnEscape: true, 
 
            }); 
 
        } 
 
    } 
 



We have prepared the sample based on your requirement. Kindly refer the below sample. 


For now, we don’t have UI level customization for your requirements. Please let us know whether this will satisfy your requirement. 

Regards, 
Kurthis Banu A. 


Loader.
Live Chat Icon For mobile
Up arrow icon