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.
Hey,
Thanks for the information.
So it looks like what I was missing is:
in html:
in ts:
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