ngx-if-empty
v1.0.2
Published
A simple way to show a template when using `*ngFor="let item of items"` and your iterable or array is empty.
Downloads
6
Readme
ngx-if-empty
A simple way to show a template when using *ngFor="let item of items"
and your iterable or array is empty.
Install:
NPM:
$ npm install ngx-if-empty
Yarn:
$ yarn add ngx-if-empty
Usage:
your.module.ts
@Module()
...
imports: [
NgxIfEmptyModule
]
...
some-component.component.html
<div class="some-list" *ngFor="let item of items; ifEmpty emptyTemplate">
{{ item | json }}
</div>
<ng-template #emptyTemplate>
<h2>No items found in array</h2>
</ng-template>
This library was generated with Nx.