1.0.2 • Published 2 years ago

ngx-if-empty v1.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

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.

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago