refactor(common): expose NgImage directive via a private API (#47082)

This commit exports experimental `NgImage` directive via a private API of the `@angular/common` package, so that it can be used acorss other Angular packages for testing purposes.

PR Close #47082
This commit is contained in:
Andrew Kushnir
2022-04-19 18:50:47 -07:00
committed by Pawel Kozlowski
parent 86e77a5d55
commit 0d330d0bcd
2 changed files with 13 additions and 1 deletions
+1
View File
@@ -27,3 +27,4 @@ export {PLATFORM_BROWSER_ID as ɵPLATFORM_BROWSER_ID, PLATFORM_SERVER_ID as ɵPL
export {VERSION} from './version';
export {ViewportScroller, NullViewportScroller as ɵNullViewportScroller} from './viewport_scroller';
export {XhrFactory} from './xhr';
export {NgImageModule as ɵNgImageModule, NgImage as ɵNgImage, IMAGE_LOADER as ɵIMAGE_LOADER} from './directives/ng_image';
+12 -1
View File
@@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.io/license
*/
import {Directive, Inject, InjectionToken, Input, SimpleChanges, ɵRuntimeError as RuntimeError} from '@angular/core';
import {Directive, Inject, InjectionToken, Input, NgModule, SimpleChanges, ɵRuntimeError as RuntimeError} from '@angular/core';
import {RuntimeErrorCode} from '../errors';
@@ -132,6 +132,17 @@ export class NgImage {
}
}
/**
* Temporary NgModule that exports the `NgImage` directive.
* The module should not be needed once the `standalone` flag is supported as a public API.
*/
@NgModule({
declarations: [NgImage],
exports: [NgImage],
})
export class NgImageModule {
}
/***** Helpers *****/
// Convert input value to integer.