Skip to main content
cngx-src documentation

CngxCardGridEmpty

Directivev0.1.0

projects/common/card/card-grid-empty.directive.ts

Import#

import { CngxCardGridEmpty } from '@cngx/common/card'

Description#

Marker directive placed on <ng-template> inside a <cngx-card-grid>.

The grid selects the template whose reason matches the grid's emptyReason input. A template without a reason acts as the default fallback.

<cngx-card-grid [items]="items()" [emptyReason]="emptyReason()">
  <ng-template cngxCardGridEmpty="no-results">
    No results found.
  </ng-template>
  <ng-template cngxCardGridEmpty>
    Nothing here yet.
  </ng-template>
</cngx-card-grid>

Metadata#

Index#

Inputs

Inputs#

input()

Empty-state reason this template handles. Omit for a default fallback.

default undefined, { alias: 'cngxCardGridEmpty', }