title: How to show data in a hbs template?
body: <p>Need some help with this, I'm trying to show data in the template but it doesn't works. I'm using NestJS with mysql.</p>
  
  <p>Here the code of the controller.ts:</p>
  
  <pre><code>import { Controller, Get, Post, Put, Delete, Body, Param, Render, UsePipes, Logger, UseGuards} from '@nestjs/common';
  import { ProductoService } from './producto.service';
  import { ProductoDTO } from './producto.dto';
  import { ValidationPipe } from '../shared/validation.pipe';
  
  
  @Controller('producto')
  export class ProductoController {
      private logger = new Logger('ProductoController');
  
      constructor(private productoService: ProductoService){}
  
      @Get('index')
      //@UseGuards(new AuthGuard())
      @Render('Producto/index')
      showAllUsers(){
          return {product:this.productoService.showAll().then(function(result){
              var aux = [{}];
              aux = result;
              console.log(aux);
              return aux;
  
          })};        
      }
  }
  </code></pre>
  
  <p>Here the code of the index.hbs handlebars template:</p>
  
  <pre><code>&lt;h2&gt;Lista de Productos&lt;/h2&gt;
  &lt;div class="entry"&gt;
      &lt;table class="table"&gt;
          &lt;tr&gt;
              &lt;th&gt;Nombre&lt;/th&gt;
              &lt;th&gt;Cantidad&lt;/th&gt;
              &lt;th&gt;Descripcion&lt;/th&gt;
              &lt;th&gt;&lt;/th&gt;
          &lt;/tr&gt;
          &lt;tr&gt;           
              {{#each aux}}
                  &lt;td&gt;{{this.name}}&lt;/td&gt;
                  &lt;td&gt;{{this.quantity}}&lt;/td&gt;
                  &lt;td&gt;{{this.description}}&lt;/td&gt;
              {{/each}} 
          &lt;/tr&gt;
      &lt;/table&gt;
      &lt;br/&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>even in the console log show me the data.</p>
  
  <p><a href="https://i.stack.imgur.com/ldr6a.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ldr6a.jpg" alt="image data log"></a></p>