fix(compiler): remove i18n markup even if no translations (#17999)

Fixes #11042
This commit is contained in:
Victor Berchet
2017-07-07 16:16:49 -07:00
committed by Jason Aden
parent 2ba3ada27f
commit 9c3386b1b7
11 changed files with 149 additions and 31 deletions

View File

@ -59,10 +59,13 @@ 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: (parser: HtmlParser, translations: string | null, format: string,
config: CompilerConfig, console: Console) => {
translations = translations || '';
const missingTranslation =
translations ? config.missingTranslation ! : MissingTranslationStrategy.Ignore;
return new i18n.I18NHtmlParser(parser, translations, format, missingTranslation, console);
},
deps: [
baseHtmlParser,
[new Optional(), new Inject(TRANSLATIONS)],