Open ajrnz opened 7 years ago
I haven't considered integration of Scala.js => TypeScript. The problem is, that the decorators are not defined in the same file as the module itself; they are defined in the -sjsx.js
file (since it is not possible to add custom members to the prototype of JS object from within Scala.js). What happens, if you import the -sjsx.js
file?
Thanks! That works (kinda)
I imported the module into my NgModule file
import sjsx from './common/sjsx.js'
referenced it so webpack doesn't strip it out:
export class AppModule {
sjsx = sjsx
}
and then I had to change the require()
in sjsx.js
to have a relative path ie:
var s = require('./scala');
I then made the sbt task which copies the files from the target
directory do the replacement.
I'm trying to migrate a project slowly to scala.js and am having trouble getting my components to be recognized in my (TypeScript) NgModule definition.
I import the symbol for the component
and then reference it as:
but get the error:
Unexpected value '$c_Lcom_transit_MyRegions' declared by the module 'AppModule'
hunting through the JavaScript I see that this is because it fails to reflectively find the annotations (Decorators) whereas for components defined in TS this succeeds.
I've tried adding @classModeJS but this makes no difference.
Using version 0.0.5