title: System dialog Angular Material
body: <p>I work for system of dialog (Angular Material).</p>
  
  <p>I create dialog-service for controll and container dialog. Dialog-service has methods for open/show different dialoges.</p>
  
  <p>And I create dialog-component for contain data for dialog (it is single component of dialog). It is universal component.</p>
  
  <p>I add <a href="https://stackblitz.com/edit/angular-material-ah8bcs" rel="nofollow noreferrer">StackBlitz</a> </p>
  
  <p>I have problem with closing dialoges after callback.
  How I can close dialog after callback? I try using <strong>[mat-dialog-close]</strong> - but I was not able to somehow parameterize - enable and disable the <strong>[mat-dialog-close]</strong> of different buttons.</p>
  
  <p>And a have little problem. How I can add dynamicly <strong>mat-button</strong> to button element?</p>
  
  <p>(I add class 'mat-button', but this don't full imitation mat-button)</p>
  
  <pre><code> &lt;div *ngIf="getButtons().length &gt; 0 || getCloseButton()" mat-dialog-actions&gt;
      &lt;ng-container *ngFor="let button of getButtons()"&gt;
        &lt;button [attr.class]="button.class"
          (click)="button.callback(button.callbackItem || dialogForm)"&gt;{{button.title}}&lt;/button&gt;
      &lt;/ng-container&gt;
  &lt;/div&gt;
  </code></pre>