My javascript code is functioning perfectly:
class myController {
constructor () {
this.language = 'english'
}
}
However, I encountered an issue when trying to replicate the same in Typescript
export default class myController {
constructor () {
this.language = 'english'
}
}
This resulted in the following error:
Property 'language' does not exist on type 'myController'.ts(2339)
Why does this error occur when attempting to create a property for myController
?
What would be the correct approach to resolve this issue?