File tree Expand file tree Collapse file tree 2 files changed +22
-8
lines changed
packages/compiler-cli/ngcc Expand file tree Collapse file tree 2 files changed +22
-8
lines changed Original file line number Diff line number Diff line change @@ -96,14 +96,14 @@ export class DtsRenderer {
96
96
const newStatement = ` static ${ declaration . name } : ${ typeStr } ;\n` ;
97
97
outputText . appendRight ( endOfClass - 1 , newStatement ) ;
98
98
} ) ;
99
+ } ) ;
99
100
100
- if ( renderInfo . reexports . length > 0 ) {
101
- for ( const e of renderInfo . reexports ) {
102
- const newStatement = `\nexport {${ e . symbolName } as ${ e . asAlias } } from '${ e . fromModule } ';` ;
103
- outputText . appendRight ( endOfClass , newStatement ) ;
104
- }
101
+ if ( renderInfo . reexports . length > 0 ) {
102
+ for ( const e of renderInfo . reexports ) {
103
+ const newStatement = `\nexport {${ e . symbolName } as ${ e . asAlias } } from '${ e . fromModule } ';` ;
104
+ outputText . append ( newStatement ) ;
105
105
}
106
- } ) ;
106
+ }
107
107
108
108
this . dtsFormatter . addModuleWithProvidersParams (
109
109
outputText , renderInfo . moduleWithProviders , importManager ) ;
Original file line number Diff line number Diff line change @@ -918,23 +918,35 @@ runInEachFileSystem(() => {
918
918
var __decorate = null;
919
919
var core_1 = require("@angular/core");
920
920
var directive_1 = require("./directive");
921
+ var LocalDir = /** @class */ (function () {
922
+ function LocalDir() {
923
+ }
924
+ LocalDir = __decorate([
925
+ core_1.Directive({
926
+ selector: '[local]',
927
+ })
928
+ ], LocalDir);
929
+ return LocalDir;
930
+ }());
921
931
var FooModule = /** @class */ (function () {
922
932
function FooModule() {
923
933
}
924
934
FooModule = __decorate([
925
935
core_1.NgModule({
926
- declarations: [directive_1.Foo],
927
- exports: [directive_1.Foo],
936
+ declarations: [directive_1.Foo, LocalDir ],
937
+ exports: [directive_1.Foo, LocalDir ],
928
938
})
929
939
], FooModule);
930
940
return FooModule;
931
941
}());
942
+ exports.LocalDir = LocalDir;
932
943
exports.FooModule = FooModule;
933
944
` ,
934
945
} ,
935
946
{
936
947
name : _ ( '/node_modules/test-package/module.d.ts' ) ,
937
948
contents : `
949
+ export declare class LocalDir {}
938
950
export declare class FooModule {}
939
951
` ,
940
952
} ,
@@ -1005,6 +1017,8 @@ runInEachFileSystem(() => {
1005
1017
expect ( jsContents ) . toContain ( 'exports.ɵngExportɵFooModuleɵFoo = ɵngcc1.Foo;' ) ;
1006
1018
expect ( dtsContents )
1007
1019
. toContain ( `export {Foo as ɵngExportɵFooModuleɵFoo} from './directive';` ) ;
1020
+ expect ( dtsContents . match ( / ɵ n g E x p o r t ɵ F o o M o d u l e ɵ F o o / g) ! . length ) . toBe ( 1 ) ;
1021
+ expect ( dtsContents ) . not . toContain ( `ɵngExportɵFooModuleɵLocalDir` ) ;
1008
1022
} ) ;
1009
1023
} ) ;
1010
1024
You can’t perform that action at this time.
0 commit comments