title: how to call a method when mat-option is selected (angular)?
body: <p>I am new to Angular and I want to call a specific method, only when option3 is selected.
  I am struggling to solve this and cannot find much information on this on the internet.</p>
  
  <p>When I call option3, the output is empty.</p>
  
  <p>Here is my code so far:</p>
  
  <p>app.component.html:</p>
  
  <pre><code>&lt;mat-form-field&gt;
    &lt;mat-label&gt;Select an option&lt;/mat-label&gt;
    &lt;mat-select [(value)]="selected" &gt;
      &lt;mat-option&gt;None&lt;/mat-option&gt;
      &lt;mat-option value="option1"&gt;Option 1&lt;/mat-option&gt;
      &lt;mat-option value="option2"&gt;Option 2&lt;/mat-option&gt;
      &lt;mat-option selectionChange="greet($event)"&gt;Option 3&lt;/mat-option&gt;
    &lt;/mat-select&gt;
  &lt;/mat-form-field&gt;
  
  &lt;p&gt;You selected: {{selected}}&lt;/p&gt;
  </code></pre>
  
  <p>app.component.ts:</p>
  
  <pre><code>import { Component } from '@angular/core';
  
  @Component({
    selector: 'app-root',
    templateUrl: './app.component.html',
    styleUrls: ['./app.component.css']
  })
  export class AppComponent {
    title = 'materialdesign';
    selected = 'option33';
  
  
    greet() {
      this.selected = 'it works';
    }
  }
  </code></pre>