<<%= jhiPrefixDashed %>-item-count [params]="{ page: page, totalItems: totalItems, itemsPerPage: itemsPerPage }"><%= jhiPrefixDashed %>-item-count>
diff --git a/generators/angular/templates/src/main/webapp/app/entities/_entityFolder_/list/_entityFile_.component.spec.ts.ejs b/generators/angular/templates/src/main/webapp/app/entities/_entityFolder_/list/_entityFile_.component.spec.ts.ejs
index 993881549954..039b1c56e3eb 100644
--- a/generators/angular/templates/src/main/webapp/app/entities/_entityFolder_/list/_entityFile_.component.spec.ts.ejs
+++ b/generators/angular/templates/src/main/webapp/app/entities/_entityFolder_/list/_entityFile_.component.spec.ts.ejs
@@ -131,7 +131,7 @@ describe('<%= entityAngularName %> Management Component', () => {
// THEN
expect(service.query).toHaveBeenCalled();
- expect(comp.<%= entityInstancePlural %><%= entityArrayOptionalChainSymbol %>[0]).toEqual(expect.objectContaining(<%- testEntityPrimaryKey %>));
+ expect(comp.<%= entityInstancePlural %>()<%= entityArrayOptionalChainSymbol %>[0]).toEqual(expect.objectContaining(<%- testEntityPrimaryKey %>));
});
describe('track<%= primaryKey.nameCapitalized %>', () => {
diff --git a/generators/angular/templates/src/main/webapp/app/entities/_entityFolder_/list/_entityFile_.component.ts.ejs b/generators/angular/templates/src/main/webapp/app/entities/_entityFolder_/list/_entityFile_.component.ts.ejs
index c0fe58bb4cc7..cc8defc9b37b 100644
--- a/generators/angular/templates/src/main/webapp/app/entities/_entityFolder_/list/_entityFile_.component.ts.ejs
+++ b/generators/angular/templates/src/main/webapp/app/entities/_entityFolder_/list/_entityFile_.component.ts.ejs
@@ -122,7 +122,7 @@ export class <%= componentName %> implements OnInit {
<%_ } _%>
subscription: Subscription | null = null;
- <%= entityInstancePlural %>?: I<%= entityAngularName %>[];
+ <%= entityInstancePlural %> = signal[]>([]);
isLoading = false;
sortState = sortStateSignal({});
@@ -173,7 +173,7 @@ export class <%= componentName %> implements OnInit {
tap(() => this.load()),
<%_ } else { _%>
tap(() => {
- if (!this.<%= entityInstancePlural %> || this.<%= entityInstancePlural %>.length === 0) {
+ if (this.<%= entityInstancePlural %>().length === 0) {
this.load();
}
}),
@@ -187,7 +187,7 @@ export class <%= componentName %> implements OnInit {
<%_ if (paginationInfiniteScroll) { _%>
reset(): void {
- this.<%= entityInstancePlural %> = [];
+ this.<%= entityInstancePlural %>.set([]);
}
loadNextPage(): void {
@@ -289,9 +289,9 @@ export class <%= componentName %> implements OnInit {
<%_ } _%>
const dataFromBody = this.fillComponentAttributesFromResponseBody(response.body);
<%_ if (paginationNo) { _%>
- this.<%= entityInstancePlural %> = this.refineData(dataFromBody);
+ this.<%= entityInstancePlural %>.set(this.refineData(dataFromBody));
<%_ } else { _%>
- this.<%= entityInstancePlural %> = dataFromBody;
+ this.<%= entityInstancePlural %>.set(dataFromBody);
<%_ } _%>
}
@@ -306,7 +306,7 @@ export class <%= componentName %> implements OnInit {
<%_ if (paginationInfiniteScroll) { _%>
// If there is previous link, data is a infinite scroll pagination content.
if (this.links().prev) {
- const <%= entityInstancePlural %>New = this.<%= entityInstancePlural %> ?? [];
+ const <%= entityInstancePlural %>New = this.<%= entityInstancePlural %>();
if (data) {
for (const d of data) {
<%_ if (primaryKey) { _%>