How do we access koa js route context (this) and es6 class this within a es6 class?
When i try to access class property using this.name i get undefined
test.js
export default class {
  constructor (opts) {
    this.name = 'test'
  }
  welcome () {
    console.log(this.name) // 'this' is UNDEFINED. Trying to access class property. But getting undefined
    this.body = 'welcome '+this.params.name // 'this' works fine here as a koa reference
  }
}
app.js
import test from './test'
let Test = new test({})
router.get('/test/:name', Test.welcome)
 
    