I have a javascript code that works perfectly:
class myController {
constructor () {
this.language = 'english'
}
}
BUT when I try to do the same with Typescript
export default class myController {
constructor () {
this.language = 'english'
}
}
It gives me the following error:
Property 'language' does not exist on type 'myController'.ts(2339)
Why exactly this happen when trying to create a property for myController
?
What would be the right way to do so?