title: Implement properly list of Objects from rest api
body: <p>I want to implement Angular example which gets list from rest API. I tried this:</p>
  
  <p>SQL query:</p>
  
  <pre><code>    @Override
      public Iterable&lt;Merchants&gt; findAll() {
          String hql = "select e from " + Merchants.class.getName() + " e";
          TypedQuery&lt;Merchants&gt; query = entityManager.createQuery(hql, Merchants.class);
          List&lt;Merchants&gt; merchants = query.getResultList();
          return merchants;
      }
  </code></pre>
  
  <p>Rest controller:</p>
  
  <pre><code>@RestController
  @RequestMapping("/merchants")
  public class MerchantController {
  
      @GetMapping("/list")
      public Iterable&lt;Merchants&gt; getMerchantsList() {
          return merchantRepository
                  .findAll();
      }
  }
  </code></pre>
  
  <p><strong>Service:</strong></p>
  
  <pre><code>@Injectable({
    providedIn: 'root'
  })
  export class MerchantService {
  
    constructor(private http: HttpClient) {
    }    
    getList() {
      return this.http.get("...../api/merchants/list");
    }
  }
  </code></pre>
  
  <p><strong>Component:</strong></p>
  
  <pre><code>@Component({
    selector: 'app-terminal',
    templateUrl: './terminal.component.html',
    styleUrls: ['./terminal.component.scss']
  })
  export class TerminalComponent implements OnInit {
    merchants: Merchant[];
    constructor(private merchantService: MerchantService,
                private router: Router,
                private route: ActivatedRoute) {
    }   
  
    ngOnInit() {               
      this.merchantService.getList();
    }    
  }
  </code></pre>
  
  <p>But when I lock the component via web page nothing happens. Can you give me some advice where I'm wrong?
  Probably my typescript is somewhere incorrect?</p>