fix(compiler-cli): only use error collector when needed. (#19912)

The error collector changes behavior of the metadata resolver
in ways that haven't been fully hardened. This changes limits
its use to the lazy route detection and the language service.

Issue: #19906

PR Close #19912
This commit is contained in:
Chuck Jazdzewski
2017-10-24 12:52:14 -07:00
committed by Matias Niemelä
parent c92efc15fb
commit 7bfeac746e
6 changed files with 19 additions and 18 deletions

View File

@ -89,7 +89,7 @@ export class NgTools_InternalApi_NG_2 {
// as we only needed this to support Angular CLI 1.5.0 rc.*
const ngProgram = createProgram({
rootNames: options.program.getRootFileNames(),
options: options.angularCompilerOptions,
options: {...options.angularCompilerOptions, collectAllErrors: true},
host: options.host
});
const lazyRoutes = ngProgram.listLazyRoutes(options.entryModule);