TypeScript Application - Shared Code in App

Dear JourneyApps

We are running a simple TypeScript application on the Journey Apps platform.

In the view js we are importing functions from another view as per the example below :

image.png

That being said, we cannot call any of the functions directly from the xml; it has to be via an intermediary function (as above).

This seems a bit peculiar.

Are we perhaps doing something wrong here?

Kind regards
Matthew Lucas

1 Like

Hi @matthew

That is unfortunately a limitation currently when importing specific functions only.

That said, if you import the entire “library/file” using this syntax, import * as mymodule from "~/lib/mymodule", you will be able to access the imported variable directly from the View XML

Please give that a go and let me know if you run into any issues