Getting Started
Version 21 introduces a breaking change: collection-based properties now include an Entities suffix for consistency and clarity.
When using traits with a collection parameter, generated property names now include Entities:
| v20 (Old) | v21 (New) |
|---|---|
productCallStatus |
productEntitiesCallStatus |
isProductLoading |
isProductEntitiesLoading |
productFilter |
productEntitiesFilter |
productPagination |
productEntitiesPagination |
loadProductPage() |
loadProductEntitiesPage() |
isAllProductSelected |
isAllProductEntitiesSelected |
This migration requires at least version 21 of angular and @ngrx/signals, so please be sure you have migrated then before executing this command
Run the automatic migration schematic:
ng update @ngrx-traits/signals --next
This will:
signalStoreFeature functionsThe migration handles:
signalStore() with collection-based traitssignalStoreFeature() (functions and variables)withCallStatus({ collection: 'product' })withCallStatus({ ...productEntityConfig })withCallStatus(productEntityConfig)const productsFeature = signalStoreFeature(...)signalStore(signalStoreFeature(...))withFeature((store) => customFeature())The migration only updates files that import or use detected stores. If you have files using collection properties indirectly, you may need to run the rename-collection schematic manually.
If your store uses an unusual pattern not detected by the analyzer, use the rename-collection schematic:
ng g @ngrx-traits/signals:rename-collection --old-name=product --path=src/app
If you prefer to migrate manually or need to handle edge cases:
Replace old property names with new ones:
// Before
store.productCallStatus();
store.isProductLoading();
store.loadProductPage({ pageIndex: 1 });
// After
store.productEntitiesCallStatus();
store.isProductEntitiesLoading();
store.loadProductEntitiesPage({ pageIndex: 1 });
<!-- Before -->
<div *ngIf="store.isProductLoading()">Loading...</div>
<button (click)="store.loadProductPage(1)">Load</button>
<!-- After -->
<div *ngIf="store.isProductEntitiesLoading()">Loading...</div>
<button (click)="store.loadProductEntitiesPage(1)">Load</button>
| v20 | v21 |
|---|---|
{col}CallStatus |
{col}EntitiesCallStatus |
{col}Error |
{col}EntitiesError |
is{Col}Loading |
is{Col}EntitiesLoading |
is{Col}Loaded |
is{Col}EntitiesLoaded |
set{Col}Loading |
set{Col}EntitiesLoading |
set{Col}Loaded |
set{Col}EntitiesLoaded |
set{Col}Error |
set{Col}EntitiesError |
| v20 | v21 |
|---|---|
{col}Pagination |
{col}EntitiesPagination |
{col}CurrentPage |
{col}EntitiesCurrentPage |
{col}PagedRequest |
{col}EntitiesPagedRequest |
load{Col}Page |
load{Col}EntitiesPage |
set{Col}PagedResult |
set{Col}EntitiesPagedResult |
loadMore{Col} |
loadMore{Col}Entities |
load{Col}NextPage |
load{Col}EntitiesNextPage |
load{Col}PreviousPage |
load{Col}EntitiesPreviousPage |
load{Col}FirstPage |
load{Col}EntitiesFirstPage |
| v20 | v21 |
|---|---|
{col}Filter |
{col}EntitiesFilter |
is{Col}FilterChanged |
is{Col}EntitiesFilterChanged |
reset{Col}Filter |
reset{Col}EntitiesFilter |
| v20 | v21 |
|---|---|
{col}Sort |
{col}EntitiesSort |
sort{Col} |
sort{Col}Entities |
| v20 | v21 |
|---|---|
isAll{Col}Selected |
isAll{Col}EntitiesSelected |
clear{Col}Selection |
clear{Col}EntitiesSelection |
Note: Single selection properties (
{col}IdSelected,{col}EntitySelected, etc.) remain unchanged.