Skip to content

Commit

Permalink
fix(TranslateModule): use exported factory function to enable AOT com…
Browse files Browse the repository at this point in the history
…piling
  • Loading branch information
frederikschubert committed Sep 7, 2016
1 parent 402bf8e commit b0bc72d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ng2-translate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ export default {
providers: [TranslateService]
};

export function translateLoaderFactory(http: Http) {
return new TranslateStaticLoader(http);
}

@NgModule({
imports: [HttpModule],
declarations: [
Expand All @@ -26,7 +30,7 @@ export default {
export class TranslateModule {
static forRoot(providedLoader: any = {
provide: TranslateLoader,
useFactory: (http: Http) => new TranslateStaticLoader(http),
useFactory: translateLoaderFactory,
deps: [Http]
}): ModuleWithProviders {
return {
Expand Down

0 comments on commit b0bc72d

Please sign in to comment.