javascript - How to make docxtemplater work with angular-fullstack? -


i new yo generator angular-fullstack. problem facing want use docxtemplater it. did

    npm install docxtemplater --save 

and

    import docxtemplater 'docxtemplater';     ...     angular.module('newapp', [ngcookies, ngresource, ngsanitize, 'btford.socket-io', uirouter,       uibootstrap, _auth, account, admin, navbar, footer, main, constants, socket, util, testdoc, docxtemplater     ]) 

in app.js

and used

    'use strict';     const angular = require('angular');      const uirouter = require('angular-ui-router');      var docxtemplater= require('docxtemplater');      import routes './testdoc.routes';      export class testdoccomponent {       /*@nginject*/       constructor() {         this.message = 'hello';          //loading file         var docx=new docxtemplater().loadfromfile("test.docx");          //setting tags         docx.settags({"name":"edgar"});          //apply tags         docx.applytags();          //output docx using datauri or fs in node         docx.output();        }     }      export default angular.module('newapp.testdoc', [uirouter])       .config(routes)       .component('testdoc', {         template: require('./testdoc.html'),         controller: testdoccomponent,         controlleras: 'testdocctrl'       })       .name; 

in testdoc.component.js

and getting following error

error: [$injector:modulerr] failed instantiate module newapp due to: [$injector:modulerr] failed instantiate module function docxtemplater(content, options) due to: [$injector:strictdi] docxtemplater not using explicit annotation , cannot invoked in strict mode http://errors.angularjs.org/1.5.8/$injector/strictdi?p0=docxtemplater

any solution this? need install this. :(

also, if cant work, there other library can generate docx files templates can imported angular-fullstack?


Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

javascript - IE9 error '$'is not defined -