Skip to content

Commit ea19a1d

Browse files
Added resources and host locale provider to runtime module (blackbaud#371)
1 parent f02a317 commit ea19a1d

File tree

4 files changed

+23
-27
lines changed

4 files changed

+23
-27
lines changed

lib/sky-pages-module-generator.js

+5-20
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ function getSource(skyAppConfig) {
2626

2727
// Any custom runtime components/directives to concat with user defined
2828
// These should also be defined in runtimeImports
29-
const runtimeComponents = [
30-
'SkyAppResourcesPipe'
31-
];
29+
const runtimeComponents = [];
3230

3331
const routes = routeGenerator.getRoutes(skyAppConfig);
3432
const names = componentNames.concat(routes.names, runtimeComponents);
@@ -60,9 +58,7 @@ function getSource(skyAppConfig) {
6058
provide: SkyAppAssetsService,
6159
useClass: ${assetsGenerator.getClassName()}
6260
}`,
63-
'SkyAppResourcesService',
64-
'SkyAppViewportService',
65-
'SkyAppHostLocaleProvider'
61+
'SkyAppViewportService'
6662
];
6763

6864
let authTokenProvider = 'SkyAuthTokenProvider';
@@ -94,7 +90,8 @@ function getSource(skyAppConfig) {
9490
];
9591

9692
let runtimeModuleExports = [
97-
...names
93+
...names,
94+
'SkyAppRuntimeModule'
9895
];
9996

10097
let runtimeModuleImports = [
@@ -165,21 +162,9 @@ import {
165162
AppExtrasModule
166163
} from '${skyAppConfig.runtime.skyPagesOutAlias}/src/app/app-extras.module';
167164
import { ${runtimeImports.join(', ')} } from '${skyAppConfig.runtime.runtimeAlias}';
168-
import { SkyAppRuntimeModule } from '${skyAppConfig.runtime.runtimeAlias}';
165+
import { SkyAppRuntimeModule } from '${skyAppConfig.runtime.runtimeAlias}/runtime.module';
169166
import { SkyAppAssetsService } from '${skyAppConfig.runtime.runtimeAlias}/assets.service';
170167
171-
import {
172-
SkyAppResourcesService
173-
} from '${skyAppConfig.runtime.runtimeAlias}/i18n/resources.service';
174-
175-
import {
176-
SkyAppResourcesPipe
177-
} from '${skyAppConfig.runtime.runtimeAlias}/i18n/resources.pipe';
178-
179-
import {
180-
SkyAppHostLocaleProvider
181-
} from '${skyAppConfig.runtime.runtimeAlias}/i18n/host-locale-provider';
182-
183168
${assetsGenerator.getSource()}
184169
185170
${routes.imports.join('\n')}

runtime/i18n/index.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
export { SkyAppLocaleProvider } from './locale-provider';
2-
export { SkyAppResourcesPipe } from './resources.pipe';
3-
export { SkyAppResourcesService } from './resources.service';
1+
export * from './host-locale-provider';
2+
export * from './locale-provider';
3+
export * from './resources.pipe';
4+
export * from './resources.service';

runtime/index.ts

-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,3 @@ export * from './style-loader';
1313
export * from './viewport.service';
1414
export * from './omnibar-provider';
1515
export * from './omnibar-ready-args';
16-
export * from './runtime.module';

runtime/runtime.module.ts

+14-3
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,27 @@ import {
77
SkyAppLinkExternalDirective
88
} from './directives';
99

10+
import {
11+
SkyAppHostLocaleProvider,
12+
SkyAppResourcesPipe,
13+
SkyAppResourcesService
14+
} from './i18n';
15+
1016
@NgModule({
1117
declarations: [
1218
SkyAppLinkDirective,
13-
SkyAppLinkExternalDirective
19+
SkyAppLinkExternalDirective,
20+
SkyAppResourcesPipe
1421
],
1522
exports: [
1623
SkyAppLinkDirective,
17-
SkyAppLinkExternalDirective
24+
SkyAppLinkExternalDirective,
25+
SkyAppResourcesPipe
1826
],
19-
providers: []
27+
providers: [
28+
SkyAppHostLocaleProvider,
29+
SkyAppResourcesService
30+
]
2031
})
2132
/* istanbul ignore next */
2233
export class SkyAppRuntimeModule { }

0 commit comments

Comments
 (0)