Skip to content

Commit

Permalink
fix(compiler): make I18NHtmlParser provider AoT-compliant (#15980)
Browse files Browse the repository at this point in the history
PR Close #15980
  • Loading branch information
dherges authored and mhevery committed Apr 20, 2017
1 parent 11b0213 commit 745731e
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions packages/compiler/src/jit/compiler_factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ const _NO_RESOURCE_LOADER: ResourceLoader = {

const baseHtmlParser = new InjectionToken('HtmlParser');

export function i18nHtmlParserFactory(
parser: HtmlParser, translations: string, format: string, config: CompilerConfig,
console: Console): i18n.I18NHtmlParser {
return new i18n.I18NHtmlParser(
parser, translations, format, config.missingTranslation !, console);
}

/**
* A set of providers that provide `JitCompiler` and its dependencies to use for
* template compilation.
Expand All @@ -56,10 +63,7 @@ export const COMPILER_PROVIDERS: Array<any|Type<any>|{[k: string]: any}|any[]> =
},
{
provide: i18n.I18NHtmlParser,
useFactory: (parser: HtmlParser, translations: string, format: string, config: CompilerConfig,
console: Console) =>
new i18n.I18NHtmlParser(
parser, translations, format, config.missingTranslation !, console),
useFactory: i18nHtmlParserFactory,
deps: [
baseHtmlParser,
[new Optional(), new Inject(TRANSLATIONS)],
Expand Down

0 comments on commit 745731e

Please sign in to comment.