title: How can I detect a click on the cancel "x" in the input type search?
body: <p>I have a search input type in my angular web app.</p>
  <pre><code>&lt;div class=&quot;input-group mb-4&quot;&gt;
          &lt;div class=&quot;input-group-prepend&quot;&gt;
            &lt;span class=&quot;input-group-text&quot;&gt;&lt;i class=&quot;fa fa-search fa-fw&quot;&gt;&lt;/i&gt;&lt;/span&gt;
          &lt;/div&gt;
          &lt;input class=&quot;form-control&quot; type=&quot;search&quot; placeholder=&quot;&quot; [(ngModel)]=&quot;searchTerm&quot; (keydown.enter)=&quot;search($event.target.value)&quot; (cancel)=&quot;onCancelSearch()&quot; &gt;
        &lt;/div&gt;
  </code></pre>
  <p>An &quot;x&quot; appears when a search term is entered. I want to detect click on that &quot;x&quot;. I have tried</p>
  <pre><code>(cancel)=&quot;onCancelSearch()&quot;
  </code></pre>
  <p>But this did not work for me. How can I detect a click on the cancel?</p>