feat(compiler): add basic support for in ivy/i18n code generation (#22654)

PR Close #22654
This commit is contained in:
Olivier Combe
2018-02-14 10:54:00 -08:00
committed by Matias Niemelä
parent e5e1b0da33
commit 204ba9d413
9 changed files with 496 additions and 85 deletions

View File

@ -65,8 +65,14 @@ export function createAotCompiler(
const symbolResolver = new StaticSymbolResolver(compilerHost, symbolCache, summaryResolver);
const staticReflector =
new StaticReflector(summaryResolver, symbolResolver, [], [], errorCollector);
const htmlParser = new I18NHtmlParser(
new HtmlParser(), translations, options.i18nFormat, options.missingTranslation, console);
let htmlParser: I18NHtmlParser;
if (!!options.enableIvy) {
// Ivy handles i18n at the compiler level so we must use a regular parser
htmlParser = new HtmlParser() as I18NHtmlParser;
} else {
htmlParser = new I18NHtmlParser(
new HtmlParser(), translations, options.i18nFormat, options.missingTranslation, console);
}
const config = new CompilerConfig({
defaultEncapsulation: ViewEncapsulation.Emulated,
useJit: false,