Cannot display tracked changes in ejs-documenteditor

Currently, you cannot preview a document in a

<ejs-documenteditor (created)="onCreate()" #documentPreview style="width:100%;height:100%;display:block">ejs-documenteditor>


Steps to replicate:

1) Create a document and enable change tracking and save JSON

2) Load document into the above document editor. Note that it is not the usual and fully qualified "ejs-documenteditorcontainer"

3) Notice the error thrown:

core.js:6479 ERROR TypeError: Cannot read property 'copyWithTrackChange' of undefined

at SfdtReader.parseRevisions (ej2-documenteditor.es2015.js:30475)

at SfdtReader.convertJsonToDocument (ej2-documenteditor.es2015.js:30396)

at DocumentEditorComponent.open (ej2-documenteditor.es2015.js:95842)

at document-preview.component.ts:40

at Object.next (Subscriber.js:123)

at SafeSubscriber.push.73366.Subscriber._next (Subscriber.js:63)

at SafeSubscriber.push.73366.Subscriber.next (Subscriber.js:34)

at map.js:7

at OperatorSubscriber._this._next (OperatorSubscriber.js:11)

at OperatorSubscriber.push.73366.Subscriber.next (Subscriber.js:34)


It seems like the document editor tries to treat the changes as if it was a fully qualified editor, but lacks the required modules to display the document as if it did have the modules.

In this view, the intent is to simply view the document with the tracked changes. Even not displaying who made the changes or when they were made is fine, we just need to be able to load the document without error.


4 Replies 1 reply marked as answer

KB Kurthis Banu Abdul Majeeth Syncfusion Team August 24, 2021 05:29 AM UTC

Hi Brandon, 

We can reproduce the reported issue. Currently, we are validating the reported issue. We will update further details by August 26,2021. 

Regards, 
Kurthis Banu A. 



SM Suriya Murugan Syncfusion Team August 26, 2021 02:51 PM UTC

Hi Brandon, 

Thanks for patience. 

We have checked the reported issue.We found the document is opening fine in ejs-documenteditor. To resolve this issue, in providers you have to give the required modules to resolve this issue. 

 
 
  

Regards, 
Suriya M. 



BM Brandon M August 26, 2021 04:41 PM UTC

Hey,


Thanks for the information.


So it looks like what I was missing is:

in html:

[enableEditor]=true


in ts:

    providers: [EditorServiceEditorHistoryServiceToolbarService]


May need less than this, but this is what I think is needed.


For anyone Googling the issue and coming up on this thread, please see an example where only tracking is enabled:


https://stackblitz.com/edit/angular-7ox8yf-gj8nwk?file=app.component.ts


Thanks for the help Kurthis!


Brandon


Marked as answer

SM Suriya Murugan Syncfusion Team August 27, 2021 04:55 AM UTC

Hi Brandon, 
 
Thanks for your update. 
 
Regards, 
Suriya M. 


Loader.
Up arrow icon