Skip to content
This repository was archived by the owner on Dec 8, 2022. It is now read-only.

Added resources and host locale provider to runtime module #371

Merged
merged 6 commits into from
Mar 20, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 5 additions & 20 deletions lib/sky-pages-module-generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ function getSource(skyAppConfig) {

// Any custom runtime components/directives to concat with user defined
// These should also be defined in runtimeImports
const runtimeComponents = [
'SkyAppResourcesPipe'
];
const runtimeComponents = [];

const routes = routeGenerator.getRoutes(skyAppConfig);
const names = componentNames.concat(routes.names, runtimeComponents);
Expand Down Expand Up @@ -60,9 +58,7 @@ function getSource(skyAppConfig) {
provide: SkyAppAssetsService,
useClass: ${assetsGenerator.getClassName()}
}`,
'SkyAppResourcesService',
'SkyAppViewportService',
'SkyAppHostLocaleProvider'
'SkyAppViewportService'
];

let authTokenProvider = 'SkyAuthTokenProvider';
Expand Down Expand Up @@ -94,7 +90,8 @@ function getSource(skyAppConfig) {
];

let runtimeModuleExports = [
...names
...names,
'SkyAppRuntimeModule'
];

let runtimeModuleImports = [
Expand Down Expand Up @@ -165,21 +162,9 @@ import {
AppExtrasModule
} from '${skyAppConfig.runtime.skyPagesOutAlias}/src/app/app-extras.module';
import { ${runtimeImports.join(', ')} } from '${skyAppConfig.runtime.runtimeAlias}';
import { SkyAppRuntimeModule } from '${skyAppConfig.runtime.runtimeAlias}';
import { SkyAppRuntimeModule } from '${skyAppConfig.runtime.runtimeAlias}/runtime.module';
import { SkyAppAssetsService } from '${skyAppConfig.runtime.runtimeAlias}/assets.service';

import {
SkyAppResourcesService
} from '${skyAppConfig.runtime.runtimeAlias}/i18n/resources.service';

import {
SkyAppResourcesPipe
} from '${skyAppConfig.runtime.runtimeAlias}/i18n/resources.pipe';

import {
SkyAppHostLocaleProvider
} from '${skyAppConfig.runtime.runtimeAlias}/i18n/host-locale-provider';

${assetsGenerator.getSource()}

${routes.imports.join('\n')}
Expand Down
7 changes: 4 additions & 3 deletions runtime/i18n/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export { SkyAppLocaleProvider } from './locale-provider';
export { SkyAppResourcesPipe } from './resources.pipe';
export { SkyAppResourcesService } from './resources.service';
export * from './host-locale-provider';
export * from './locale-provider';
export * from './resources.pipe';
export * from './resources.service';
1 change: 0 additions & 1 deletion runtime/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,3 @@ export * from './style-loader';
export * from './viewport.service';
export * from './omnibar-provider';
export * from './omnibar-ready-args';
export * from './runtime.module';
17 changes: 14 additions & 3 deletions runtime/runtime.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,27 @@ import {
SkyAppLinkExternalDirective
} from './directives';

import {
SkyAppHostLocaleProvider,
SkyAppResourcesPipe,
SkyAppResourcesService
} from './i18n';

@NgModule({
declarations: [
SkyAppLinkDirective,
SkyAppLinkExternalDirective
SkyAppLinkExternalDirective,
SkyAppResourcesPipe
],
exports: [
SkyAppLinkDirective,
SkyAppLinkExternalDirective
SkyAppLinkExternalDirective,
SkyAppResourcesPipe
],
providers: []
providers: [
SkyAppHostLocaleProvider,
SkyAppResourcesService
]
})
/* istanbul ignore next */
export class SkyAppRuntimeModule { }