Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebODF in Angular 2+ #950

Open
darken89 opened this issue Feb 7, 2019 · 0 comments
Open

WebODF in Angular 2+ #950

darken89 opened this issue Feb 7, 2019 · 0 comments

Comments

@darken89
Copy link

darken89 commented Feb 7, 2019

Hi all,

I'm trying to use WebODF library in an Angular 6 project. I followed these steps:

  1. Imported library js in my index.html:
    <script src="assets/js/webodf/webodf.js" type="text/javascript" charset="utf-8"></script>

  2. In my angular component I'll try to write the sample in the website ("Getting Started"):
    ngOnInit() { const odfelement = document.getElementById('odf'); const odfcanvas = new odf.OdfCanvas(odfelement); odfcanvas.load("myfile.odt"); }

  3. Now, when browser performs the above statements, I get the following error in the console:

SlidesViewerComponent_Host.ngfactory.js? [sm]:1 ERROR TypeError: core.Utils is not a constructor
at new odf.Formatting (webodf.js:254)
at new odf.OdfCanvas (webodf.js:326)
at SlidesViewerComponent.push../src/app/pages/training/slides-viewer/slides-viewer.component.ts.SlidesViewerComponent.ngOnInit (slides-viewer.component.ts:16)
at checkAndUpdateDirectiveInline (core.js:10105)
at checkAndUpdateNodeInline (core.js:11371)
at checkAndUpdateNode (core.js:11333)
at debugCheckAndUpdateNode (core.js:11970)
at debugCheckDirectivesFn (core.js:11930)
at Object.eval [as updateDirectives] (SlidesViewerComponent_Host.ngfactory.js? [sm]:1)
at Object.debugUpdateDirectives [as updateDirectives] (core.js:11922)`

I can't understand what is the problem. Could you help me?

Thank you in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant