I have one main form through which I pass data from 10 different components, each including the ID
of a table that I need to retrieve data from in the database. The issue I am facing is that the code responsible for fetching this data asynchronously is spread across 10 different .js
controllers. For instance, to retrieve User data from the database, I must import /path/.../userController.js
at the beginning of the script section. After parsing some strings, I obtained the following result:
var path = /path/.../javascriptController
However, if I try to include the following line at the top of the script section:
import Controller from path;
I naturally receive an error. Is there any way to import .js
files like this:
import Controller from {{ path }}
How can I resolve this dilemma?