title: TypeError: Cannot read property 'method' of undefined using react router (express)
body: <p>I have the following class using React with express.</p>
  <p>I'm trying to call another method from the method <code>getOne</code> which is declared in a route. But when I call the route for method <code>getOne</code> I have this error:</p>
  <pre><code>TypeError: Cannot read property 'createFromSystem' of undefined
      at /home/joao/tcc/efono-api/src/controllers/ContrastiveAnalysis/phonetic_inventory.controller.ts:193:42
      at Generator.next (&lt;anonymous&gt;)
      at fulfilled (/home/joao/tcc/efono-api/src/controllers/ContrastiveAnalysis/phonetic_inventory.controller.ts:5:58)
      at process._tickCallback (internal/process/next_tick.js:68:7)
  </code></pre>
  <p>How can I solve this problem? Anyone can help? I already try another things without sucess. I'm newby with react.</p>
  <p>The class:</p>
  <pre><code>import { Router, Response } from 'express';
  import { AuthenticatedRequest } from '@interfaces/AuthenticatedRequest';
  
  import authenticationMiddleware from '@middlewares/authentication.middleware';
  import authorizationMiddleware from '@middlewares/authorization.middleware';
  import validationMiddleware from '@middlewares/validation.middleware';
  import asyncWrapper from '@utils/asyncWrapper';
  
  import Controller from '@interfaces/Controller';
  import PhoneticInventoryModel, { PhoneticInventory, Plosiva, Fricativa, Africada, Nasal, Glide, Outro, LiquidaLateral, LiquidaNaoLateral, PhoneticInventoryClass } from '@models/ContrastiveAnalysis/phonetic_inventory.model';
  import PhonemaRealizatonModel, { PhonemaRealization } from '@models/ContrastiveAnalysis/phonema_realization.model';
  import { Role } from '@models/user.model';
  import { NotFoundException } from '@exceptions/NotFoundException';
  
  class PhoneticInventoryController implements Controller {
      public path = '/phoneticInventory';
      public router = Router();
  
      constructor() {
          this.initializeRoutes();
          // This binding is necessary to make `this` work in the callback
          this.createFromSystem = this.createFromSystem.bind(this);
      }
  
      private initializeRoutes() {
          this.router.get(
              `${this.path}/getOne/:evaluationId/:targetWordId`,
              asyncWrapper(authenticationMiddleware),
              asyncWrapper(this.getOne)
          );
      }
  
      private async getOne(request: AuthenticatedRequest&lt;any&gt;, response: Response) {
          const evaluationId = request.params.evaluationId;
          const targetWordId = request.params.targetWordId;
  
          if (!evaluationId || !targetWordId) {
              return Promise.reject(new NotFoundException());
          }
  
          const evaluation = await PhoneticInventoryModel.findOne({ evaluationId, targetWordId });
  
         if (!evaluation) {
              const otherEval = await this.createFromSystem(evaluationId, targetWordId);
              if (!otherEval) {
                  return Promise.reject(new NotFoundException());
              }
              response.status(200).send(otherEval);
          } else {
              response.status(200).send(evaluation);
          }
      }
  
      private async createFromSystem(evaluationId: string, targetWordId: string): Promise&lt;PhoneticInventory&gt; {
          console.log(&quot;Calculating phonetic inventory for &quot; + evaluationId + &quot; (&quot; + targetWordId + &quot;)...&quot;);
  
          if (!evaluationId || !targetWordId) {
              return null;
          }
  
          const phonemaRealization = await PhonemaRealizatonModel.findOne({ evaluationId, targetWordId });
  
          if (!phonemaRealization) {
              return null;
          }
  
          const phoneticInventory: PhoneticInventory = {
              plosiva, fricativa, africada, nasal, glide, outro, liquida_lateral, liquida_nao_lateral
          };
          return phoneticInventory;
      }
  }
  
  export default PhoneticInventoryController;
  </code></pre>