Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion goldens/public-api/common/index.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ export class NgOptimizedImage implements OnInit, OnChanges {
static ngAcceptInputType_priority: unknown;
// (undocumented)
static ngAcceptInputType_width: unknown;
ngOnChanges(changes: SimpleChanges): void;
ngOnChanges(changes: SimpleChanges<NgOptimizedImage>): void;
ngOnInit(): void;
ngSrc: string;
ngSrcset: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export class LCPImageObserver implements OnDestroy {
return observer;
}

registerImage(rewrittenSrc: string, originalNgSrc: string, isPriority: boolean) {
registerImage(rewrittenSrc: string, isPriority: boolean) {
if (!this.observer) return;
const newObservedImageState: ObservedImageState = {
priority: isPriority,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ export class NgOptimizedImage implements OnInit, OnChanges {
/**
* Calculate the rewritten `src` once and store it.
* This is needed to avoid repetitive calculations and make sure the directive cleanup in the
* `ngOnDestroy` does not rely on the `IMAGE_LOADER` logic (which in turn can rely on some other
* `DestroyRef.onDestroy` does not rely on the `IMAGE_LOADER` logic (which in turn can rely on some other
* instance that might be already destroyed).
*/
private _renderedSrc: string | null = null;
Expand Down Expand Up @@ -454,7 +454,7 @@ export class NgOptimizedImage implements OnInit, OnChanges {
assertNoLoaderParamsWithoutLoader(this, this.imageLoader);

ngZone.runOutsideAngular(() => {
this.lcpObserver!.registerImage(this.getRewrittenSrc(), this.ngSrc, this.priority);
this.lcpObserver!.registerImage(this.getRewrittenSrc(), this.priority);
});

if (this.priority) {
Expand Down Expand Up @@ -523,7 +523,7 @@ export class NgOptimizedImage implements OnInit, OnChanges {
}

/** @docs-private */
ngOnChanges(changes: SimpleChanges) {
ngOnChanges(changes: SimpleChanges<NgOptimizedImage>) {
if (ngDevMode) {
assertNoPostInitInputChange(this, changes, [
'ngSrcset',
Expand All @@ -537,7 +537,7 @@ export class NgOptimizedImage implements OnInit, OnChanges {
'disableOptimizedSrcset',
]);
}
if (changes['ngSrc'] && !changes['ngSrc'].isFirstChange()) {
if (changes.ngSrc && !changes.ngSrc.isFirstChange()) {
const oldSrc = this._renderedSrc;
this.updateSrcAndSrcset(true);

Expand All @@ -554,7 +554,7 @@ export class NgOptimizedImage implements OnInit, OnChanges {

if (
ngDevMode &&
changes['placeholder']?.currentValue &&
changes.placeholder?.currentValue &&
typeof ngServerMode !== 'undefined' &&
!ngServerMode
) {
Expand Down