title: When I use MatDialog, ngOnInit only fire the first time. Why?
body: <p>I got some datas from Firebase and I use them in a Component called Categories that I open in a dialog box with MatDialog. </p>
  
  <p>When I open the dialog for the first time, I got my datas and they are displayed. But when <strong>I close the dialog and reopen it</strong>, the datas disappear.</p>
  
  <p>I subscribe the datas in ngOnInit. </p>
  
  <p><strong>add-event.component.ts</strong></p>
  
  <pre class="lang-js prettyprint-override"><code>    export class AddEventComponent implements OnInit {
  
        constructor(private dialog: MatDialog) { }
  
        openDialog() {
  
              const dialogRef = this.dialog.open(CategoriesComponent, {
                  height: '400px',
                  width: '600px',
              });
  
              dialogRef.afterClosed().subscribe(result =&gt; {
                  console.log(`Dialog result: ${result}`); // Pizza!
              });
  
  
  
          }
  
      }
  </code></pre>
  
  <p><strong>categories.component.ts</strong></p>
  
  <pre class="lang-js prettyprint-override"><code>    export class CategoriesComponent implements OnInit {
  
          categories: Category[];
  
          constructor(private categoryService: CategoryService) {
          }
  
          ngOnInit() {
  
              this.categoryService.getCategories().subscribe(categories =&gt; {
                  console.log(categories);
                  this.categories = categories;
              });
          }
      }
  </code></pre>
  
  <p><strong>categories.component.html</strong></p>
  
  <pre class="lang-html prettyprint-override"><code>    &lt;h2 mat-dialog-title&gt;Delete all&lt;/h2&gt;
      &lt;mat-dialog-content&gt;
  
  
        &lt;div *ngIf="categories?.length &gt;0; else noCategories"&gt;
          &lt;ul *ngFor="let category of categories" class="collection"&gt;
            &lt;li (dblclick)="deleteCategory($event, category)" class="collection-item"&gt;
              &lt;b&gt;{{category.name}}&lt;/b&gt; : {{category.color}}
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;/div&gt;
  
        &lt;ng-template #noCategories&gt;
          &lt;hr&gt;
          &lt;h5&gt;No Categories&lt;/h5&gt;
        &lt;/ng-template&gt;
  
      &lt;/mat-dialog-content&gt;
      &lt;mat-dialog-actions&gt;
        &lt;button mat-button mat-dialog-close&gt;No&lt;/button&gt;
        &lt;!-- The mat-dialog-close directive optionally accepts a value as a result for the dialog. --&gt;
        &lt;button mat-button [mat-dialog-close]="true"&gt;Yes&lt;/button&gt;
      &lt;/mat-dialog-actions&gt;
  </code></pre>
  
  <p>Is something that I'm doing wrong? Do I need to pass the data through the Dialog (this solution seems not clean...) ?</p>
  
  <p>Thanks !</p>