diff --git a/goldens/public-api/common/index.md b/goldens/public-api/common/index.md index 904604de875..f4de51d8794 100644 --- a/goldens/public-api/common/index.md +++ b/goldens/public-api/common/index.md @@ -567,14 +567,12 @@ export class NgOptimizedImage implements OnInit, OnChanges, OnDestroy { set priority(value: string | boolean | undefined); // (undocumented) get priority(): boolean; - // @deprecated - set rawSrc(value: string); sizes?: string; set width(value: string | number | undefined); // (undocumented) get width(): number | undefined; // (undocumented) - static ɵdir: i0.ɵɵDirectiveDeclaration; + static ɵdir: i0.ɵɵDirectiveDeclaration; // (undocumented) static ɵfac: i0.ɵɵFactoryDeclaration; } diff --git a/packages/common/src/directives/ng_optimized_image/ng_optimized_image.ts b/packages/common/src/directives/ng_optimized_image/ng_optimized_image.ts index 1f8d9d00619..b6ed871cd19 100644 --- a/packages/common/src/directives/ng_optimized_image/ng_optimized_image.ts +++ b/packages/common/src/directives/ng_optimized_image/ng_optimized_image.ts @@ -207,7 +207,7 @@ export const IMAGE_CONFIG = new InjectionToken( */ @Directive({ standalone: true, - selector: 'img[ngSrc],img[rawSrc]', + selector: 'img[ngSrc]', host: { '[style.position]': 'fill ? "absolute" : null', '[style.width]': 'fill ? "100%" : null', @@ -235,29 +235,6 @@ export class NgOptimizedImage implements OnInit, OnChanges, OnDestroy { */ private _renderedSrc: string|null = null; - /** - * Previously, the `rawSrc` attribute was used to activate the directive. - * The attribute was renamed to `ngSrc` and this input just produces an error, - * suggesting to switch to `ngSrc` instead. - * - * This error should be removed in v15. - * - * @nodoc - * @deprecated Use `ngSrc` instead. - */ - @Input() - set rawSrc(value: string) { - if (ngDevMode) { - throw new RuntimeError( - RuntimeErrorCode.INVALID_INPUT, - `${imgDirectiveDetails(value, false)} the \`rawSrc\` attribute was used ` + - `to activate the directive. Newer version of the directive uses the \`ngSrc\` ` + - `attribute instead. Please replace \`rawSrc\` with \`ngSrc\` and ` + - `\`rawSrcset\` with \`ngSrcset\` attributes in the template to ` + - `enable image optimizations.`); - } - } - /** * Name of the source image. * Image name will be processed by the image loader and the final URL will be applied as the `src` diff --git a/packages/common/test/directives/ng_optimized_image_spec.ts b/packages/common/test/directives/ng_optimized_image_spec.ts index 9301487e7e4..943e0babbed 100644 --- a/packages/common/test/directives/ng_optimized_image_spec.ts +++ b/packages/common/test/directives/ng_optimized_image_spec.ts @@ -288,21 +288,6 @@ describe('Image directive', () => { 'attribute.'); }); - it('should throw if an old `rawSrc` is present', () => { - setupTestingModule(); - - const template = ''; - expect(() => { - const fixture = createTestComponent(template); - fixture.detectChanges(); - }) - .toThrowError( - 'NG02952: The NgOptimizedImage directive has detected that the `rawSrc` ' + - 'attribute was used to activate the directive. Newer version of the directive uses ' + - 'the `ngSrc` attribute instead. Please replace `rawSrc` with `ngSrc` and ' + - '`rawSrcset` with `ngSrcset` attributes in the template to enable image optimizations.'); - }); - it('should throw if `ngSrc` contains a Base64-encoded image (that starts with `data:`)', () => { setupTestingModule();