How to share the common code between angular2+ and jsreport.



  • Hi!
    I'm new here and it seems a nice forum!

    I have shared the common code between client code (which use angular1) and jsreport server, it works fine.
    But now I need to upgrade the client code to angular2+ and typescript, and I am a new comer to typescript and angular2+.

    If you could give me some suggestion or idea that would be much appreciated.
    I put my question at below.

    1. Is there possible to run the angualr2+ with jsreport-chrome-pdf?
    2. Did you have any suggestion to convert angular2+ and typescript code to run with the jsreport?
    3. If I only convert the typescript to js(don't combine typescript with angualr2+ code), are the converted code and jsreport compatible?

    Thanks,
    Michael


  • administrators

    hi! personally i don't have any angular 2 experience but here are some answers

    I have shared the common code between client code (which use angular1) and jsreport server, it works fine.

    can you explain what kind of code are you sharing between jsreport and your angular app? is it some utils functions?

    Is there possible to run the angualr2+ with jsreport-chrome-pdf?

    yes, i don't see any reason for this to not work

    Did you have any suggestion to convert angular2+ and typescript code to run with the jsreport?

    since i don't have any experience with angular2 or with typescript i can't help much here, i would say that you need to compile everything down to plain js and try to load the js in other contexts (like jsreport).

    If I only convert the typescript to js(don't combine typescript with angualr2+ code), are the converted code and jsreport compatible?

    yes, i think so, but it really depends on how your compiler works, i mean what kind of expectations it has, if the final js is a bundle that it is designed to run as standalone then it should work fine.



  • Thank you for helping.

    can you explain what kind of code are you sharing between jsreport and your angular app? is it some utils functions?

    I share the angular service(service-directive-controller) and model( Model–view–controller ) between the client and jsreport.

    --michael


Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.