@angular/common 21.0.0-rc.1 → 21.0.0-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v21.0.0-rc.1
2
+ * @license Angular v21.0.0-rc.2
3
3
  * (c) 2010-2025 Google LLC. https://angular.dev/
4
4
  * License: MIT
5
5
  */
@@ -10,7 +10,7 @@ import { Injectable } from '@angular/core';
10
10
  class PlatformNavigation {
11
11
  static ɵfac = i0.ɵɵngDeclareFactory({
12
12
  minVersion: "12.0.0",
13
- version: "21.0.0-rc.1",
13
+ version: "21.0.0-rc.2",
14
14
  ngImport: i0,
15
15
  type: PlatformNavigation,
16
16
  deps: [],
@@ -18,7 +18,7 @@ class PlatformNavigation {
18
18
  });
19
19
  static ɵprov = i0.ɵɵngDeclareInjectable({
20
20
  minVersion: "12.0.0",
21
- version: "21.0.0-rc.1",
21
+ version: "21.0.0-rc.2",
22
22
  ngImport: i0,
23
23
  type: PlatformNavigation,
24
24
  providedIn: 'platform',
@@ -27,7 +27,7 @@ class PlatformNavigation {
27
27
  }
28
28
  i0.ɵɵngDeclareClassMetadata({
29
29
  minVersion: "12.0.0",
30
- version: "21.0.0-rc.1",
30
+ version: "21.0.0-rc.2",
31
31
  ngImport: i0,
32
32
  type: PlatformNavigation,
33
33
  decorators: [{
@@ -1 +1 @@
1
- {"version":3,"file":"_platform_navigation-chunk.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/packages/common/src/navigation/platform_navigation.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n Injectable,\n ɵNavigateEvent as NavigateEvent,\n ɵNavigation as Navigation,\n ɵNavigationCurrentEntryChangeEvent as NavigationCurrentEntryChangeEvent,\n ɵNavigationHistoryEntry as NavigationHistoryEntry,\n ɵNavigationNavigateOptions as NavigationNavigateOptions,\n ɵNavigationOptions as NavigationOptions,\n ɵNavigationReloadOptions as NavigationReloadOptions,\n ɵNavigationResult as NavigationResult,\n ɵNavigationTransition as NavigationTransition,\n ɵNavigationUpdateCurrentEntryOptions as NavigationUpdateCurrentEntryOptions,\n} from '@angular/core';\n\n/**\n * This class wraps the platform Navigation API which allows server-specific and test\n * implementations.\n *\n * Browser support is limited, so this API may not be available in all environments,\n * may contain bugs, and is experimental.\n *\n * @experimental 21.0.0\n */\n@Injectable({providedIn: 'platform', useFactory: () => (window as any).navigation})\nexport abstract class PlatformNavigation implements Navigation {\n abstract entries(): NavigationHistoryEntry[];\n abstract currentEntry: NavigationHistoryEntry | null;\n abstract updateCurrentEntry(options: NavigationUpdateCurrentEntryOptions): void;\n abstract transition: NavigationTransition | null;\n abstract canGoBack: boolean;\n abstract canGoForward: boolean;\n abstract navigate(url: string, options?: NavigationNavigateOptions | undefined): NavigationResult;\n abstract reload(options?: NavigationReloadOptions | undefined): NavigationResult;\n abstract traverseTo(key: string, options?: NavigationOptions | undefined): NavigationResult;\n abstract back(options?: NavigationOptions | undefined): NavigationResult;\n abstract forward(options?: NavigationOptions | undefined): NavigationResult;\n abstract onnavigate: ((this: Navigation, ev: NavigateEvent) => any) | null;\n abstract onnavigatesuccess: ((this: Navigation, ev: Event) => any) | null;\n abstract onnavigateerror: ((this: Navigation, ev: ErrorEvent) => any) | null;\n abstract oncurrententrychange:\n | ((this: Navigation, ev: NavigationCurrentEntryChangeEvent) => any)\n | null;\n abstract addEventListener(type: unknown, listener: unknown, options?: unknown): void;\n abstract removeEventListener(type: unknown, listener: unknown, options?: unknown): void;\n abstract dispatchEvent(event: Event): boolean;\n}\n"],"names":["PlatformNavigation","deps","target","i0","ɵɵFactoryTarget","Injectable","providedIn","useFactory","window","navigation","decorators","args"],"mappings":";;;;;;;;;MAgCsBA,kBAAkB,CAAA;;;;;UAAlBA,kBAAkB;AAAAC,IAAAA,IAAA,EAAA,EAAA;AAAAC,IAAAA,MAAA,EAAAC,EAAA,CAAAC,eAAA,CAAAC;AAAA,GAAA,CAAA;;;;;UAAlBL,kBAAkB;AAAAM,IAAAA,UAAA,EADf,UAAU;AAAcC,IAAAA,UAAA,EAAAA,MAAOC,MAAc,CAACC;AAAU,GAAA,CAAA;;;;;;QAC3DT,kBAAkB;AAAAU,EAAAA,UAAA,EAAA,CAAA;UADvCL,UAAU;AAACM,IAAAA,IAAA,EAAA,CAAA;AAACL,MAAAA,UAAU,EAAE,UAAU;AAAEC,MAAAA,UAAU,EAAEA,MAAOC,MAAc,CAACC;KAAW;;;;;;"}
1
+ {"version":3,"file":"_platform_navigation-chunk.mjs","sources":["../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/packages/common/src/navigation/platform_navigation.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n Injectable,\n ɵNavigateEvent as NavigateEvent,\n ɵNavigation as Navigation,\n ɵNavigationCurrentEntryChangeEvent as NavigationCurrentEntryChangeEvent,\n ɵNavigationHistoryEntry as NavigationHistoryEntry,\n ɵNavigationNavigateOptions as NavigationNavigateOptions,\n ɵNavigationOptions as NavigationOptions,\n ɵNavigationReloadOptions as NavigationReloadOptions,\n ɵNavigationResult as NavigationResult,\n ɵNavigationTransition as NavigationTransition,\n ɵNavigationUpdateCurrentEntryOptions as NavigationUpdateCurrentEntryOptions,\n} from '@angular/core';\n\n/**\n * This class wraps the platform Navigation API which allows server-specific and test\n * implementations.\n *\n * Browser support is limited, so this API may not be available in all environments,\n * may contain bugs, and is experimental.\n *\n * @experimental 21.0.0\n */\n@Injectable({providedIn: 'platform', useFactory: () => (window as any).navigation})\nexport abstract class PlatformNavigation implements Navigation {\n abstract entries(): NavigationHistoryEntry[];\n abstract currentEntry: NavigationHistoryEntry | null;\n abstract updateCurrentEntry(options: NavigationUpdateCurrentEntryOptions): void;\n abstract transition: NavigationTransition | null;\n abstract canGoBack: boolean;\n abstract canGoForward: boolean;\n abstract navigate(url: string, options?: NavigationNavigateOptions | undefined): NavigationResult;\n abstract reload(options?: NavigationReloadOptions | undefined): NavigationResult;\n abstract traverseTo(key: string, options?: NavigationOptions | undefined): NavigationResult;\n abstract back(options?: NavigationOptions | undefined): NavigationResult;\n abstract forward(options?: NavigationOptions | undefined): NavigationResult;\n abstract onnavigate: ((this: Navigation, ev: NavigateEvent) => any) | null;\n abstract onnavigatesuccess: ((this: Navigation, ev: Event) => any) | null;\n abstract onnavigateerror: ((this: Navigation, ev: ErrorEvent) => any) | null;\n abstract oncurrententrychange:\n | ((this: Navigation, ev: NavigationCurrentEntryChangeEvent) => any)\n | null;\n abstract addEventListener(type: unknown, listener: unknown, options?: unknown): void;\n abstract removeEventListener(type: unknown, listener: unknown, options?: unknown): void;\n abstract dispatchEvent(event: Event): boolean;\n}\n"],"names":["PlatformNavigation","deps","target","i0","ɵɵFactoryTarget","Injectable","providedIn","useFactory","window","navigation","decorators","args"],"mappings":";;;;;;;;;MAgCsBA,kBAAkB,CAAA;;;;;UAAlBA,kBAAkB;AAAAC,IAAAA,IAAA,EAAA,EAAA;AAAAC,IAAAA,MAAA,EAAAC,EAAA,CAAAC,eAAA,CAAAC;AAAA,GAAA,CAAA;;;;;UAAlBL,kBAAkB;AAAAM,IAAAA,UAAA,EADf,UAAU;AAAcC,IAAAA,UAAA,EAAAA,MAAOC,MAAc,CAACC;AAAU,GAAA,CAAA;;;;;;QAC3DT,kBAAkB;AAAAU,EAAAA,UAAA,EAAA,CAAA;UADvCL,UAAU;AAACM,IAAAA,IAAA,EAAA,CAAA;AAACL,MAAAA,UAAU,EAAE,UAAU;AAAEC,MAAAA,UAAU,EAAEA,MAAOC,MAAc,CAACC;KAAW;;;;;;"}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v21.0.0-rc.1
2
+ * @license Angular v21.0.0-rc.2
3
3
  * (c) 2010-2025 Google LLC. https://angular.dev/
4
4
  * License: MIT
5
5
  */
@@ -1 +1 @@
1
- {"version":3,"file":"_xhr-chunk.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/packages/common/src/cookie.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/packages/common/src/xhr.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nexport function parseCookieValue(cookieStr: string, name: string): string | null {\n name = encodeURIComponent(name);\n for (const cookie of cookieStr.split(';')) {\n const eqIndex = cookie.indexOf('=');\n const [cookieName, cookieValue]: string[] =\n eqIndex == -1 ? [cookie, ''] : [cookie.slice(0, eqIndex), cookie.slice(eqIndex + 1)];\n if (cookieName.trim() === name) {\n return decodeURIComponent(cookieValue);\n }\n }\n return null;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\n/**\n * A wrapper around the `XMLHttpRequest` constructor.\n *\n * @publicApi\n */\nexport abstract class XhrFactory {\n abstract build(): XMLHttpRequest;\n}\n"],"names":["parseCookieValue","cookieStr","name","encodeURIComponent","cookie","split","eqIndex","indexOf","cookieName","cookieValue","slice","trim","decodeURIComponent","XhrFactory"],"mappings":";;;;;;AAQgB,SAAAA,gBAAgBA,CAACC,SAAiB,EAAEC,IAAY,EAAA;AAC9DA,EAAAA,IAAI,GAAGC,kBAAkB,CAACD,IAAI,CAAC;EAC/B,KAAK,MAAME,MAAM,IAAIH,SAAS,CAACI,KAAK,CAAC,GAAG,CAAC,EAAE;AACzC,IAAA,MAAMC,OAAO,GAAGF,MAAM,CAACG,OAAO,CAAC,GAAG,CAAC;AACnC,IAAA,MAAM,CAACC,UAAU,EAAEC,WAAW,CAAC,GAC7BH,OAAO,IAAI,CAAC,CAAC,GAAG,CAACF,MAAM,EAAE,EAAE,CAAC,GAAG,CAACA,MAAM,CAACM,KAAK,CAAC,CAAC,EAAEJ,OAAO,CAAC,EAAEF,MAAM,CAACM,KAAK,CAACJ,OAAO,GAAG,CAAC,CAAC,CAAC;AACtF,IAAA,IAAIE,UAAU,CAACG,IAAI,EAAE,KAAKT,IAAI,EAAE;MAC9B,OAAOU,kBAAkB,CAACH,WAAW,CAAC;AACxC;AACF;AACA,EAAA,OAAO,IAAI;AACb;;MCNsBI,UAAU,CAAA;;;;"}
1
+ {"version":3,"file":"_xhr-chunk.mjs","sources":["../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/packages/common/src/cookie.ts","../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/packages/common/src/xhr.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nexport function parseCookieValue(cookieStr: string, name: string): string | null {\n name = encodeURIComponent(name);\n for (const cookie of cookieStr.split(';')) {\n const eqIndex = cookie.indexOf('=');\n const [cookieName, cookieValue]: string[] =\n eqIndex == -1 ? [cookie, ''] : [cookie.slice(0, eqIndex), cookie.slice(eqIndex + 1)];\n if (cookieName.trim() === name) {\n return decodeURIComponent(cookieValue);\n }\n }\n return null;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\n/**\n * A wrapper around the `XMLHttpRequest` constructor.\n *\n * @publicApi\n */\nexport abstract class XhrFactory {\n abstract build(): XMLHttpRequest;\n}\n"],"names":["parseCookieValue","cookieStr","name","encodeURIComponent","cookie","split","eqIndex","indexOf","cookieName","cookieValue","slice","trim","decodeURIComponent","XhrFactory"],"mappings":";;;;;;AAQgB,SAAAA,gBAAgBA,CAACC,SAAiB,EAAEC,IAAY,EAAA;AAC9DA,EAAAA,IAAI,GAAGC,kBAAkB,CAACD,IAAI,CAAC;EAC/B,KAAK,MAAME,MAAM,IAAIH,SAAS,CAACI,KAAK,CAAC,GAAG,CAAC,EAAE;AACzC,IAAA,MAAMC,OAAO,GAAGF,MAAM,CAACG,OAAO,CAAC,GAAG,CAAC;AACnC,IAAA,MAAM,CAACC,UAAU,EAAEC,WAAW,CAAC,GAC7BH,OAAO,IAAI,CAAC,CAAC,GAAG,CAACF,MAAM,EAAE,EAAE,CAAC,GAAG,CAACA,MAAM,CAACM,KAAK,CAAC,CAAC,EAAEJ,OAAO,CAAC,EAAEF,MAAM,CAACM,KAAK,CAACJ,OAAO,GAAG,CAAC,CAAC,CAAC;AACtF,IAAA,IAAIE,UAAU,CAACG,IAAI,EAAE,KAAKT,IAAI,EAAE;MAC9B,OAAOU,kBAAkB,CAACH,WAAW,CAAC;AACxC;AACF;AACA,EAAA,OAAO,IAAI;AACb;;MCNsBI,UAAU,CAAA;;;;"}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v21.0.0-rc.1
2
+ * @license Angular v21.0.0-rc.2
3
3
  * (c) 2010-2025 Google LLC. https://angular.dev/
4
4
  * License: MIT
5
5
  */
@@ -62,7 +62,7 @@ class NavigationAdapterForLocation extends Location {
62
62
  }
63
63
  static ɵfac = i0.ɵɵngDeclareFactory({
64
64
  minVersion: "12.0.0",
65
- version: "21.0.0-rc.1",
65
+ version: "21.0.0-rc.2",
66
66
  ngImport: i0,
67
67
  type: NavigationAdapterForLocation,
68
68
  deps: [],
@@ -70,14 +70,14 @@ class NavigationAdapterForLocation extends Location {
70
70
  });
71
71
  static ɵprov = i0.ɵɵngDeclareInjectable({
72
72
  minVersion: "12.0.0",
73
- version: "21.0.0-rc.1",
73
+ version: "21.0.0-rc.2",
74
74
  ngImport: i0,
75
75
  type: NavigationAdapterForLocation
76
76
  });
77
77
  }
78
78
  i0.ɵɵngDeclareClassMetadata({
79
79
  minVersion: "12.0.0",
80
- version: "21.0.0-rc.1",
80
+ version: "21.0.0-rc.2",
81
81
  ngImport: i0,
82
82
  type: NavigationAdapterForLocation,
83
83
  decorators: [{
@@ -99,7 +99,7 @@ function isPlatformServer(platformId) {
99
99
  return platformId === PLATFORM_SERVER_ID;
100
100
  }
101
101
 
102
- const VERSION = new Version('21.0.0-rc.1');
102
+ const VERSION = /* @__PURE__ */new Version('21.0.0-rc.2');
103
103
 
104
104
  class ViewportScroller {
105
105
  static ɵprov =
@@ -463,7 +463,7 @@ class LCPImageObserver {
463
463
  }
464
464
  static ɵfac = i0.ɵɵngDeclareFactory({
465
465
  minVersion: "12.0.0",
466
- version: "21.0.0-rc.1",
466
+ version: "21.0.0-rc.2",
467
467
  ngImport: i0,
468
468
  type: LCPImageObserver,
469
469
  deps: [],
@@ -471,7 +471,7 @@ class LCPImageObserver {
471
471
  });
472
472
  static ɵprov = i0.ɵɵngDeclareInjectable({
473
473
  minVersion: "12.0.0",
474
- version: "21.0.0-rc.1",
474
+ version: "21.0.0-rc.2",
475
475
  ngImport: i0,
476
476
  type: LCPImageObserver,
477
477
  providedIn: 'root'
@@ -479,7 +479,7 @@ class LCPImageObserver {
479
479
  }
480
480
  i0.ɵɵngDeclareClassMetadata({
481
481
  minVersion: "12.0.0",
482
- version: "21.0.0-rc.1",
482
+ version: "21.0.0-rc.2",
483
483
  ngImport: i0,
484
484
  type: LCPImageObserver,
485
485
  decorators: [{
@@ -550,7 +550,7 @@ class PreconnectLinkChecker {
550
550
  }
551
551
  static ɵfac = i0.ɵɵngDeclareFactory({
552
552
  minVersion: "12.0.0",
553
- version: "21.0.0-rc.1",
553
+ version: "21.0.0-rc.2",
554
554
  ngImport: i0,
555
555
  type: PreconnectLinkChecker,
556
556
  deps: [],
@@ -558,7 +558,7 @@ class PreconnectLinkChecker {
558
558
  });
559
559
  static ɵprov = i0.ɵɵngDeclareInjectable({
560
560
  minVersion: "12.0.0",
561
- version: "21.0.0-rc.1",
561
+ version: "21.0.0-rc.2",
562
562
  ngImport: i0,
563
563
  type: PreconnectLinkChecker,
564
564
  providedIn: 'root'
@@ -566,7 +566,7 @@ class PreconnectLinkChecker {
566
566
  }
567
567
  i0.ɵɵngDeclareClassMetadata({
568
568
  minVersion: "12.0.0",
569
- version: "21.0.0-rc.1",
569
+ version: "21.0.0-rc.2",
570
570
  ngImport: i0,
571
571
  type: PreconnectLinkChecker,
572
572
  decorators: [{
@@ -616,7 +616,7 @@ class PreloadLinkCreator {
616
616
  }
617
617
  static ɵfac = i0.ɵɵngDeclareFactory({
618
618
  minVersion: "12.0.0",
619
- version: "21.0.0-rc.1",
619
+ version: "21.0.0-rc.2",
620
620
  ngImport: i0,
621
621
  type: PreloadLinkCreator,
622
622
  deps: [],
@@ -624,7 +624,7 @@ class PreloadLinkCreator {
624
624
  });
625
625
  static ɵprov = i0.ɵɵngDeclareInjectable({
626
626
  minVersion: "12.0.0",
627
- version: "21.0.0-rc.1",
627
+ version: "21.0.0-rc.2",
628
628
  ngImport: i0,
629
629
  type: PreloadLinkCreator,
630
630
  providedIn: 'root'
@@ -632,7 +632,7 @@ class PreloadLinkCreator {
632
632
  }
633
633
  i0.ɵɵngDeclareClassMetadata({
634
634
  minVersion: "12.0.0",
635
- version: "21.0.0-rc.1",
635
+ version: "21.0.0-rc.2",
636
636
  ngImport: i0,
637
637
  type: PreloadLinkCreator,
638
638
  decorators: [{
@@ -666,6 +666,7 @@ class NgOptimizedImage {
666
666
  renderer = inject(Renderer2);
667
667
  imgElement = inject(ElementRef).nativeElement;
668
668
  injector = inject(Injector);
669
+ destroyRef = inject(DestroyRef);
669
670
  lcpObserver;
670
671
  _renderedSrc = null;
671
672
  ngSrc;
@@ -686,8 +687,7 @@ class NgOptimizedImage {
686
687
  constructor() {
687
688
  if (ngDevMode) {
688
689
  this.lcpObserver = this.injector.get(LCPImageObserver);
689
- const destroyRef = inject(DestroyRef);
690
- destroyRef.onDestroy(() => {
690
+ this.destroyRef.onDestroy(() => {
691
691
  if (!this.priority && this._renderedSrc !== null) {
692
692
  this.lcpObserver.unregisterImage(this._renderedSrc);
693
693
  }
@@ -708,7 +708,7 @@ class NgOptimizedImage {
708
708
  assertNotBlobUrl(this);
709
709
  if (this.fill) {
710
710
  assertEmptyWidthAndHeight(this);
711
- ngZone.runOutsideAngular(() => assertNonZeroRenderedHeight(this, this.imgElement, this.renderer));
711
+ ngZone.runOutsideAngular(() => assertNonZeroRenderedHeight(this, this.imgElement, this.renderer, this.destroyRef));
712
712
  } else {
713
713
  assertNonEmptyWidthAndHeight(this);
714
714
  if (this.height !== undefined) {
@@ -717,7 +717,7 @@ class NgOptimizedImage {
717
717
  if (this.width !== undefined) {
718
718
  assertGreaterThanZero(this, this.width, 'width');
719
719
  }
720
- ngZone.runOutsideAngular(() => assertNoImageDistortion(this, this.imgElement, this.renderer));
720
+ ngZone.runOutsideAngular(() => assertNoImageDistortion(this, this.imgElement, this.renderer, this.destroyRef));
721
721
  }
722
722
  assertValidLoadingInput(this);
723
723
  assertValidDecodingInput(this);
@@ -920,6 +920,10 @@ class NgOptimizedImage {
920
920
  };
921
921
  const removeLoadListenerFn = this.renderer.listen(img, 'load', callback);
922
922
  const removeErrorListenerFn = this.renderer.listen(img, 'error', callback);
923
+ this.destroyRef.onDestroy(() => {
924
+ removeLoadListenerFn();
925
+ removeErrorListenerFn();
926
+ });
923
927
  callOnLoadIfImageIsLoaded(img, callback);
924
928
  }
925
929
  setHostAttribute(name, value) {
@@ -927,7 +931,7 @@ class NgOptimizedImage {
927
931
  }
928
932
  static ɵfac = i0.ɵɵngDeclareFactory({
929
933
  minVersion: "12.0.0",
930
- version: "21.0.0-rc.1",
934
+ version: "21.0.0-rc.2",
931
935
  ngImport: i0,
932
936
  type: NgOptimizedImage,
933
937
  deps: [],
@@ -935,7 +939,7 @@ class NgOptimizedImage {
935
939
  });
936
940
  static ɵdir = i0.ɵɵngDeclareDirective({
937
941
  minVersion: "16.1.0",
938
- version: "21.0.0-rc.1",
942
+ version: "21.0.0-rc.2",
939
943
  type: NgOptimizedImage,
940
944
  isStandalone: true,
941
945
  selector: "img[ngSrc]",
@@ -975,7 +979,7 @@ class NgOptimizedImage {
975
979
  }
976
980
  i0.ɵɵngDeclareClassMetadata({
977
981
  minVersion: "12.0.0",
978
- version: "21.0.0-rc.1",
982
+ version: "21.0.0-rc.2",
979
983
  ngImport: i0,
980
984
  type: NgOptimizedImage,
981
985
  decorators: [{
@@ -1185,7 +1189,7 @@ function assertGreaterThanZero(dir, inputValue, inputName) {
1185
1189
  throw new _RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc)} \`${inputName}\` has an invalid value. ` + `To fix this, provide \`${inputName}\` as a number greater than 0.`);
1186
1190
  }
1187
1191
  }
1188
- function assertNoImageDistortion(dir, img, renderer) {
1192
+ function assertNoImageDistortion(dir, img, renderer, destroyRef) {
1189
1193
  const callback = () => {
1190
1194
  removeLoadListenerFn();
1191
1195
  removeErrorListenerFn();
@@ -1230,6 +1234,10 @@ function assertNoImageDistortion(dir, img, renderer) {
1230
1234
  removeLoadListenerFn();
1231
1235
  removeErrorListenerFn();
1232
1236
  });
1237
+ destroyRef.onDestroy(() => {
1238
+ removeLoadListenerFn();
1239
+ removeErrorListenerFn();
1240
+ });
1233
1241
  callOnLoadIfImageIsLoaded(img, callback);
1234
1242
  }
1235
1243
  function assertNonEmptyWidthAndHeight(dir) {
@@ -1245,7 +1253,7 @@ function assertEmptyWidthAndHeight(dir) {
1245
1253
  throw new _RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc)} the attributes \`height\` and/or \`width\` are present ` + `along with the \`fill\` attribute. Because \`fill\` mode causes an image to fill its containing ` + `element, the size attributes have no effect and should be removed.`);
1246
1254
  }
1247
1255
  }
1248
- function assertNonZeroRenderedHeight(dir, img, renderer) {
1256
+ function assertNonZeroRenderedHeight(dir, img, renderer, destroyRef) {
1249
1257
  const callback = () => {
1250
1258
  removeLoadListenerFn();
1251
1259
  removeErrorListenerFn();
@@ -1259,6 +1267,10 @@ function assertNonZeroRenderedHeight(dir, img, renderer) {
1259
1267
  removeLoadListenerFn();
1260
1268
  removeErrorListenerFn();
1261
1269
  });
1270
+ destroyRef.onDestroy(() => {
1271
+ removeLoadListenerFn();
1272
+ removeErrorListenerFn();
1273
+ });
1262
1274
  callOnLoadIfImageIsLoaded(img, callback);
1263
1275
  }
1264
1276
  function assertValidLoadingInput(dir) {