I want to create components with typescript and registering them with:
ko.components.register("my-component", {
viewModel: {require: "widgets/my-component"},
template: {require: "text!widgets/my-component.html"}
});
The component is a typescript class:
export class MyComponent {
constructor(private params) {
...
But this generate an error at runtime because the class is not instantiated:
`Uncaught Error: Component 'my-component': Unknown viewModel value: [object Object]`
I think I have to change my typescript definition to export an instance of MyComponent, but I don't know how to pass the params to the constructor.
`const inst = new MyComponent(???); export inst;`
Any Idea?
Thanks!
mario
--
You received this message because you are subscribed to the Google Groups "KnockoutJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to knockoutjs+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/knockoutjs/6cb98e11-9639-46a1-b8f9-b86724ee30f8n%40googlegroups.com.