Solved
INCLUDE A JS FILE IN THINGWORX
I want to develop something in js and call it from a service in thing, can anyone have an idea ?
thanks in advance .
I want to develop something in js and call it from a service in thing, can anyone have an idea ?
thanks in advance .
Hello
In ThingWorx you can't import dependencies directly from files, because all code is in the database, so you need to wrap it into ThingWorx entities first.
For example, instead of this:
import { calculator } from "my-calculator-module";
var sum = calculator.add(1, 2);
you can do something like that:
var calculator = Things["MyCalculatorModule"];
var sum = calculator.add({ x: 1, y: 2 });
Regards,
Constantine
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.