I get some gro data from an external resourse, placing it in the Server Connect (serverconnect1)
Now I need to process this data in a separate JS file (let’s say, js/map.js).
How can I address this data in this JS file? I tried using dmx.parse, but get errors. And I’m not sure if the App objects sre visible in my custom JS file.
Unfortunately, it’s not clear for me how to move data from Server Connect to JSON and then somehow to a separate JavaScript file. Can you provide a clue?
Actually , I thought here is a direct way from anywhere of the project to App components and their data. Is that false?
Why do you want to move the server connect data to a separate file?
The server connect action itself outputs already json so you can just call it and get the json as response. This is how app connect works.
You can just open the server connect action in the browser - there is an option for it in the context menu or F12. Then it will be opened in tge browser directly and you can see its output.
Why do you want to move the server connect data to a separate file?
I use Server Connect on my index.ejs page to suck external geographical data.
But then I need to pass this data to a separate JS file, which is located in the public/js subfolder.
This JS file works with this geo data - starts a map, insert map markers and so on.
There will be a lot of code which I can't move to in my index.ejs file. So I need to find a solution how to take an App data (from Server Connect, or from variable) and make it available in my js/map.js file.
upd. Because there can be many .ejs files in the project, I probably need to specify the page that contains necessay Server Connect (or variable) with data to priocess.