title: Couldn't call method inside method controller in route Nodejs Express Typescript
body: <p>I got two classes; authenticationRoutes.ts and authenticationController.ts. In authenticationRoutes I'm calling 'authenticationController.test', the 'authenticationController.test' method calls 'authenticationController.generateAccessAuthToken' method. Whenever I do this I get the following Error: <strong>Unhandled rejection TypeError: Cannot read property 'generateAccessAuthToken'
  of undefined</strong></p>
  
  <pre><code>authenticationRoutes.ts
  import { authenticationController } from '../controllers/authenticationController';
  
          //TEST ROUTE
          this.router.get('/users',  authenticationController.test);
  
  </code></pre>
  
  <pre><code>authenticationController.ts
  
  
  public test(req: Request, res: Response) {
          dbSequelize().User.findAll({
              where: {
                  id: '0'
              },
              attributes: ['id']
          }).then((user: UserInstance[]) =&gt; {
              this.generateAccessAuthToken('0').then((response: any) =&gt; {
                  console.log(response);
                  res.send(response);
              });
          })
      }
  
  
  generateAccessAuthToken(_id: any) {
          return new Promise(async (resolve, reject) =&gt; {
              await jwt.sign({ id: _id }, SECRET_KEY as string, function (err: Error, token: any) {
                  if (err) {
                      reject(err);
                  } else {
                      resolve(token);
                  }
              })
          })
      }
  
  </code></pre>
  
  <p>I want to be able to do what I described without receiving an error.</p>