fix(compiler): walk third party modules (#12453)
fixes #11889 fixes #12428
This commit is contained in:

committed by
Igor Minar

parent
bfc97ff2cd
commit
a838aba756
@ -378,15 +378,15 @@ export class CompileMetadataResolver {
|
||||
}
|
||||
|
||||
private _getTypeDescriptor(type: Type<any>): string {
|
||||
if (this._directiveResolver.resolve(type, false) !== null) {
|
||||
if (this._directiveResolver.resolve(type, false)) {
|
||||
return 'directive';
|
||||
}
|
||||
|
||||
if (this._pipeResolver.resolve(type, false) !== null) {
|
||||
if (this._pipeResolver.resolve(type, false)) {
|
||||
return 'pipe';
|
||||
}
|
||||
|
||||
if (this._ngModuleResolver.resolve(type, false) !== null) {
|
||||
if (this._ngModuleResolver.resolve(type, false)) {
|
||||
return 'module';
|
||||
}
|
||||
|
||||
@ -508,7 +508,7 @@ export class CompileMetadataResolver {
|
||||
let isOptional = false;
|
||||
let query: Query = null;
|
||||
let viewQuery: Query = null;
|
||||
var token: any = null;
|
||||
let token: any = null;
|
||||
if (Array.isArray(param)) {
|
||||
param.forEach((paramEntry) => {
|
||||
if (paramEntry instanceof Host) {
|
||||
@ -605,19 +605,20 @@ export class CompileMetadataResolver {
|
||||
} else if (isValidType(provider)) {
|
||||
compileProvider = this.getTypeMetadata(provider, staticTypeModuleUrl(provider));
|
||||
} else {
|
||||
let providersInfo = (<string[]>providers.reduce(
|
||||
(soFar: string[], seenProvider: any, seenProviderIdx: number) => {
|
||||
if (seenProviderIdx < providerIdx) {
|
||||
soFar.push(`${stringify(seenProvider)}`);
|
||||
} else if (seenProviderIdx == providerIdx) {
|
||||
soFar.push(`?${stringify(seenProvider)}?`);
|
||||
} else if (seenProviderIdx == providerIdx + 1) {
|
||||
soFar.push('...');
|
||||
}
|
||||
return soFar;
|
||||
},
|
||||
[]))
|
||||
.join(', ');
|
||||
const providersInfo =
|
||||
(<string[]>providers.reduce(
|
||||
(soFar: string[], seenProvider: any, seenProviderIdx: number) => {
|
||||
if (seenProviderIdx < providerIdx) {
|
||||
soFar.push(`${stringify(seenProvider)}`);
|
||||
} else if (seenProviderIdx == providerIdx) {
|
||||
soFar.push(`?${stringify(seenProvider)}?`);
|
||||
} else if (seenProviderIdx == providerIdx + 1) {
|
||||
soFar.push('...');
|
||||
}
|
||||
return soFar;
|
||||
},
|
||||
[]))
|
||||
.join(', ');
|
||||
|
||||
throw new Error(
|
||||
`Invalid ${debugInfo ? debugInfo : 'provider'} - only instances of Provider and Type are allowed, got: [${providersInfo}]`);
|
||||
|
Reference in New Issue
Block a user