forty-cdk
llms.txt

Error codes

FORCDK-TREE-002

Thrown by forty-cdk/tree.

[forty-cdk/tree] FORCDK-TREE-002: {piece} must be used inside a [forTree] or [forTreeGroup] element.

Cause

No FOR_TREE_CONTAINER_CONTEXT provider is visible from {piece}. Angular resolves a directive's dependencies at the template's declaration site rather than where it is stamped, so a piece declared in an ng-template outside the root resolves nothing even when it renders inside it.

Fix

Move {piece} inside a [forTree] or [forTreeGroup] element, declaring any ng-template it lives in there too.

Where it comes from

projects/forty-cdk/tree/src/tree-context.ts:313

Read the tree documentation

A value in braces is filled in when the message is reported, so the sentence in your console names the piece, input or value that failed.