refactor(common): drop deprecated selector from the NgOptimizedImage directive (#47798)

This commit updates the NgOptimizedImage directive to:
- drop a deprecated selector (the `rawSrc` one)
- drop corresponding input getter

The `rawSrc` was replaced by the `ngSrc` one during the developer preview phase.

PR Close #47798
This commit is contained in:
Andrew Kushnir
2022-10-17 21:26:27 -07:00
committed by Dylan Hunn
parent ce5880f93f
commit bdd4d14db9
3 changed files with 2 additions and 42 deletions
@@ -207,7 +207,7 @@ export const IMAGE_CONFIG = new InjectionToken<ImageConfig>(
*/
@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`