title: Get object data from openDialog in angular material
body: <p>Hi i'm new in angular.</p>
  <p>So I have this json object:</p>
  <pre><code>{
      &quot;id&quot;: &quot;1&quot;,
      &quot;name&quot;: &quot;2019-A&quot;,
      &quot;createdBy&quot;: &quot;Adrian&quot;,
      &quot;creationDate&quot;: &quot;1552211000&quot;,
      &quot;orders&quot;: [{&quot;id&quot;: &quot;1&quot;, &quot;name&quot;:&quot;2019-01&quot;}, {&quot;id&quot;: &quot;2&quot;, &quot;name&quot;:&quot;2019-02&quot;}]
  }
  </code></pre>
  <p>This is an object that rappresents an project. So I have a list with projects, when I click one item I show a list with orders of the selected project.</p>
  <p><a href="https://i.stack.imgur.com/zgMg8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zgMg8.png" alt="enter image description here" /></a></p>
  <p>So I have for each order in the list one button. I would like to show order details when I click the button.</p>
  <p>This is the code about button click:</p>
  <pre><code>&lt;mat-grid-tile&gt;
          &lt;mat-selection-list [multiple]=&quot;false&quot;&gt;
              &lt;mat-list-option *ngFor=&quot;let ord of selectedOrders&quot;&gt;
                  &lt;span&gt;
                      {{ ord.name }}
                      &lt;button mat-raised-button color=&quot;primary&quot; (click)=&quot;openDialog(ord)&quot;&gt;Order Details&lt;/button&gt;                    
                  &lt;/span&gt;                
              &lt;/mat-list-option&gt;
          &lt;/mat-selection-list&gt;
      &lt;/mat-grid-tile&gt;
  </code></pre>
  <p>order.component.html:</p>
  <pre><code>&lt;div&gt;{{id}} - {{name}}&lt;/div&gt;
  </code></pre>
  <p>projects.component.ts:</p>
  <pre><code>openDialog(ord: OrderModel) {
      //debugger;
      this.dialog.open(OrdersComponent, {
        data: {
          id: ord.id,
          name: ord.name,
        }
      });
    }
  </code></pre>
  <p>This is the result:
  <a href="https://i.stack.imgur.com/kclnm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kclnm.png" alt="enter image description here" /></a></p>
  <p>Cannot load id and name of the order. I can see only the - symbol.</p>