title: Return value from object array where a certain requirment is met
body: <p>In my template I have products, which have an image. You can order these products which needs to make the image a different image. An order can have multiple statusses being Order placed, Ordered and Received. I need to get the status from the product with a certain Id. This is my template: </p>
  
  <pre><code>&lt;div *ngFor="let lproduct of locationProducts"&gt;
        &lt;div class="productDivWidth" *ngIf="lproduct.departmentId.departmentId == location.departmentId.departmentId"&gt;
          {{lproduct.productId.productName}}
          &lt;br&gt;
          &lt;img *ngIf="IsOrdered(lproduct.productId.productId) === null" src="{{lproduct.productId.productImage}}"
            class="product-image"&gt;
          &lt;img *ngIf="IsOrdered(lproduct.productId.productId) === Openstaand"
            src="https://image.flaticon.com/icons/svg/175/175461.svg" class="product-image"&gt;
          &lt;br&gt;
          &lt;button class="btn btn-default" data-toggle="modal" data-target="#exampleModal"
            (click)="OrderProduct(lproduct.productDepartmentId)"&gt;&lt;/button&gt;
        &lt;/div&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>My function: </p>
  
  <pre><code> IsOrdered(id: number) {
      return this.orders.filter(e =&gt; e.productId.productId === id).statusId.statusName;
    }
  </code></pre>