0

I only want the hits returned from Algolia to display when the user presses enter or if they hit the search icon on the input. I have got it so that only the specific hits are shown on enter using searchAsyouType = false:

<ais-search-box [searchAsYouType]=false  ></ais-search-box>

However the problem is that when nothing is entered all of the hits are displayed by default as shown below: enter image description here

this is my code:

<ais-instantsearch [config]="searchConfig" >

  <ais-search-box [searchAsYouType]=false  ></ais-search-box>

  <ais-hits >
    <ng-template let-hits="hits">
      <div *ngFor="let hit of hits">

        <div class="bio">
          hit: {{ hit.post_code }}
        </div>

      </div>
    </ng-template>
  </ais-hits>
</ais-instantsearch>

Anyone had this issue before? How do I hide all hits until enter/search icon is pressed?

Jm3s
  • 556
  • 2
  • 12
  • 24

1 Answers1

0

The false should be "false". Or just remove the tag as the default is "false". That would leave you with:

<ais-search-box></ais-search-box>
David Buck
  • 3,752
  • 35
  • 31
  • 35