SpreadJS Designer - Angular

Posted by: mathieu.bilodeau-roy on 25 May 2021, 3:42 am EST

    • Post Options:
    • Link

    Posted 25 May 2021, 3:42 am EST

    Hi,

    I have been trying to integrate the Designer in an angular app following those steps:

    https://www.grapecity.com/spreadjs/docs/v14/online/designer-angular.html

    Unfortunately, on both an existing application and a brand new one, importing the DesignerModule (without even using it) results in this error:

    
    Uncaught TypeError: Cannot read property 'res' of undefined
        at Object../src/commands/defaultConfig.ts (vendor.js:720)
        at r (vendor.js:720)
        at Object../src/all.entry.ts (vendor.js:720)
        at r (vendor.js:720)
        at z.Spread.Sheets.Designer.../localization/resentry (vendor.js:720)
        at vendor.js:720
        at vendor.js:717
        at Object./ApW (vendor.js:720)
        at __webpack_require__ (runtime.js:80)
        at Object.ws2t (vendor.js:68765)
    
    

    Is there a step missing from the documentation? Is this a known issue?

    Thank you,

    Mathieu

  • Posted 26 May 2021, 12:32 am EST

    Hi,

    This error usually comes when we do not import the designer resource file. Please refer to the attached sample that demonstrates how you could use the designer component in angular and if the issue persists please share a sample that replicates the issue so that we investigate it further and assist you accordingly.

    Regards,

    Avinash

    AngularTestApp.zip

  • Posted 26 May 2021, 4:34 am EST

    Thank you,

    After looking at your code, it seems like the only issue was the order of the imports for the resources and the module.

    After switching back the order, it seems to work well.

    Thanks

  • Posted 27 October 2021, 7:51 pm EST

    Hi - I experience the same error and your code sample helped me out. I am trying to use the Designer in a lazy loaded module, and what I have found is that if I don’t import the resources file into my app component (even though that is not where I am trying to use the package) it fails with the same error OP mentioned… Does this seem correct to you ?

  • Posted 28 October 2021, 8:57 pm EST

    Hi,

    This is expected because the resource file is needed for a designer to load so even If we do not use the rescue file it is needed for a designer to load its content.

    I hope that helps.

    Regards

    Avinash

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels