How do I remove asterisk from required field in Angular Material and add (optional) beside label for optional labels

For people who are still looking for answer. For Angular material 5 and 6. You can use [hideRequiredMarker]="hideRequired". In you component you can provide its value as hideRequired="true". By this you can show or hide asterisk according to your need. But this directive is a part of <mat-form-field> not of input elements.

<mat-form-field [hideRequiredMarker]="hideRequiredMarker">
  <input matInput placeholder="Simple placeholder" required>
</<mat-form-field>

Make sure to check the version of angular and angular material. These should match. Otherwise you can get errors. Thanks