Skip to content
This repository has been archived by the owner on Jun 27, 2023. It is now read-only.

Empty result, send messenger to the user #13

Open
kevenjesus opened this issue Aug 21, 2017 · 4 comments
Open

Empty result, send messenger to the user #13

kevenjesus opened this issue Aug 21, 2017 · 4 comments

Comments

@kevenjesus
Copy link

Hey guys,

if a result is empty, using is code

(events | filter: terms).length === 0

for exemple

<tr *ngIf="events.length === 0 || (events | filter: terms).length === 0">
     <td colspan="6" class="text-center">not events result</td>
</tr>

Thanks a your plugin! it`s amazin :)

@Alex61NN5
Copy link

Does this actually work? I cant seem to make it work.

@aVolpe
Copy link
Collaborator

aVolpe commented Oct 5, 2018

@Alex61NN5 can you provide some parts of your code?

@navinna
Copy link

navinna commented Apr 17, 2019

<tr *ngIf=" !(events.length) || !((events | filter: terms).length) ">
<td colspan="6" class="text-center">not events result</td>
</tr>

Worked for me!

@0xMurage
Copy link

for future you, use the as keyword to alias the results and avoid double data filter processing. e.g.

<tbody *ngIf="(events|filter:term) as rows">
   <tr *ngFor="let row of rows; let i=index">
      <!-- display your data here-->
  </tr>
 
<!-- empty state i.e. when there is no data and user is searching-->  
<ng-container *ngIf="isSearching && rows.length==0">
     <tr class="no-data">
       <td colspan="6" > No data matching the filter criteria</td>
     </tr>
   </ng-container>
</tbody>

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants