I'm trying to use Kotlin to write angular JavaScript code. Here is some valid Javascript code for angular:
const AppComponent = function () {
this.title = 'Angular Hello World Demo'
};
AppComponent.annotations = [new ng.core.Component({
selector: 'hello-app',
templateUrl: './app/app.component.html',
styleUrls: ['./app/app.component.css']
})];
But I can't write proper Kotlin code to generate such form of JavaScript code.
I tried to use companion object:
class MyComponent {
companion object {
val annotations = ...
}
}
But it actually generates
function MyComponent() {}
function AppComponent$Companion() {
this.annotations = ...
}
which is not working.
Is it possible to fix it?