diff --git a/apps/test-app-e2e/src/e2e/resize.cy.ts b/apps/test-app-e2e/src/e2e/resize.cy.ts index 989459e3..4a22c735 100644 --- a/apps/test-app-e2e/src/e2e/resize.cy.ts +++ b/apps/test-app-e2e/src/e2e/resize.cy.ts @@ -3,9 +3,9 @@ describe('resize', () => { it('should react to viewport resize', () => { cy.viewport(500, 500); - cy.get('pre').should('contain.text', '"width": 485'); + cy.get('pre').should('contain.text', '"width": 500'); cy.viewport(800, 800); - cy.get('pre').should('contain.text', '"width": 785'); + cy.get('pre').should('contain.text', '"width": 800'); }); }); diff --git a/apps/test-app/project.json b/apps/test-app/project.json index e0c3a12f..2cf4c1af 100644 --- a/apps/test-app/project.json +++ b/apps/test-app/project.json @@ -13,7 +13,6 @@ "outputPath": "dist/apps/test-app", "index": "apps/test-app/src/index.html", "browser": "apps/test-app/src/main.ts", - "polyfills": ["zone.js"], "tsConfig": "apps/test-app/tsconfig.app.json", "assets": ["apps/test-app/src/favicon.ico", "apps/test-app/src/assets"], "styles": ["apps/test-app/src/styles.css"], diff --git a/apps/test-app/src/app/app.component.ts b/apps/test-app/src/app/app.component.ts index 9a83abe1..6ce2fa92 100644 --- a/apps/test-app/src/app/app.component.ts +++ b/apps/test-app/src/app/app.component.ts @@ -32,7 +32,9 @@ import { RouterLink, RouterOutlet } from '@angular/router'; Active Element
- {{ 'en' | displayNames: 'script' }} - => {{ 'en' | displayNames: 'script' }} + {{ 'Hang' | displayNames: 'script' }} + => {{ 'Hang' | displayNames: 'script' }}
{{ 'en' | displayNames: 'region' }} diff --git a/apps/test-app/src/app/track-by/track-by.component.ts b/apps/test-app/src/app/track-by/track-by.component.ts index 75079de8..759e8910 100644 --- a/apps/test-app/src/app/track-by/track-by.component.ts +++ b/apps/test-app/src/app/track-by/track-by.component.ts @@ -5,6 +5,7 @@ import { ElementRef, ViewChild, inject, + signal, } from '@angular/core'; import { TrackById, TrackByProp } from 'ngxtension/trackby-id-prop'; @@ -30,13 +31,13 @@ import { TrackById, TrackByProp } from 'ngxtension/trackby-id-prop';
- Without TrackBy mutations: {{ mutationsLength.withoutTrackBy }} + Without TrackBy mutations: {{ mutationsLength.withoutTrackBy() }}
- With TrackBy mutations: {{ mutationsLength.withTrackBy }} + With TrackBy mutations: {{ mutationsLength.withTrackBy() }}
- With TrackBy prop mutations: {{ mutationsLength.withTrackByProp }} + With TrackBy prop mutations: {{ mutationsLength.withTrackByProp() }}
`, imports: [NgFor, TrackById, TrackByProp], @@ -47,13 +48,17 @@ export default class TrackByTest { { id: 2, firstName: 'Enea', lastName: 'Jahollari' }, { id: 3, firstName: 'Daniele', lastName: 'Morosinotto' }, ]; - mutationsLength = { withTrackBy: 0, withTrackByProp: 0, withoutTrackBy: 0 }; + mutationsLength = { + withTrackBy: signal(0), + withTrackByProp: signal(0), + withoutTrackBy: signal(0), + }; private destroyRef = inject(DestroyRef); private mutationCallback = (type: keyof typeof this.mutationsLength): MutationCallback => (mutations) => { - this.mutationsLength[type] += mutations.length; + this.mutationsLength[type].update((prev) => prev + mutations.length); }; @ViewChild('parentNoTrackBy', { static: true }) set parentNoTrackBy({