Closed andraaspar closed 7 years ago
This should be valid:
import * as m from 'mithril'
export default class Form implements Mithril.Component<any> {
view() {
return m('h3', 'Todos')
}
}
But it emits an error:
Class 'Form' incorrectly implements interface 'Component<any>'.
Property 'controller' is missing in type 'Form'.
I'd merge a simple PR for this. (Good catch, BTW. It's easy to miss a single character like that.)
Description:
mithril.d.ts declares the controller method as required, whereas the documentation says it is optional. This causes components written in TypeScript to always require a controller.
Expected:
Actual:
Adding that question mark seems to do the trick.