parent
abdd524911
commit
3416984cce
|
@ -79,15 +79,15 @@ export class RuntimeMetadataResolver {
|
||||||
`Unexpected directive value '${stringify(directives[i])}' on the View of component '${stringify(component)}'`);
|
`Unexpected directive value '${stringify(directives[i])}' on the View of component '${stringify(component)}'`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return removeDuplicatedDirectives(directives.map(type => this.getMetadata(type)));
|
|
||||||
|
return removeDuplicates(directives).map(type => this.getMetadata(type));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function removeDuplicatedDirectives(directives: cpl.CompileDirectiveMetadata[]):
|
function removeDuplicates(items: any[]): any[] {
|
||||||
cpl.CompileDirectiveMetadata[] {
|
let m = new Map<any, any>();
|
||||||
var directivesMap = new Map<Type, cpl.CompileDirectiveMetadata>();
|
items.forEach(i => m.set(i, null));
|
||||||
directives.forEach((dirMeta) => { directivesMap.set(dirMeta.type.runtime, dirMeta); });
|
return MapWrapper.keys(m);
|
||||||
return MapWrapper.values(directivesMap);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function flattenDirectives(view: ViewMetadata): Type[] {
|
function flattenDirectives(view: ViewMetadata): Type[] {
|
||||||
|
|
Loading…
Reference in New Issue