Skip to main content
cngx-src documentation

CngxErrorTpl

Directivev0.1.0

projects/data-display/treetable/column-template.directive.ts

Import#

import { CngxErrorTpl } from '@cngx/data-display/treetable'

Description#

Marks an <ng-template> as the error slot shown when a bound async state fails - both on a first-load failure (grid gone) and on a failed refresh over loaded rows (content+error). Gets the raw error as $implicit, so the consumer can render the actual failure instead of the default "Data failed to load" message.

Do not add role="alert" inside the template: the treetable's state live region already announces the failure, and an alert would double-fire.

<cngx-treetable [tree]="tree" [state]="loadState">
  <ng-template cngxError let-error>
    <p>Load failed: {{ describeError(error) }}</p>
    <button type="button" (click)="reload()">Retry</button>
  </ng-template>
</cngx-treetable>

Metadata#