fix(typings): repair broken type-checking for StringMap

Note that the previous type of StringMap was overly permissive and didn't catch errors.
Also we have to explicitly type empty objects, which is explained here:
https://github.com/Microsoft/TypeScript/issues/5089

Closes #4487
This commit is contained in:
Alex Eagle
2015-10-02 17:33:21 -07:00
committed by Alex Eagle
parent 7c4199cd1c
commit 208f3d4c65
16 changed files with 36 additions and 36 deletions

View File

@ -46,8 +46,8 @@ export class DirectiveResolver {
propertyMetadata: {[key: string]: any[]}): DirectiveMetadata {
var inputs = [];
var outputs = [];
var host = {};
var queries = {};
var host: {[key: string]: string} = {};
var queries: {[key: string]: any} = {};
StringMapWrapper.forEach(propertyMetadata, (metadata: any[], propName: string) => {
metadata.forEach(a => {

View File

@ -55,9 +55,9 @@ export class ProtoViewFactory {
var result = this._cache.get(compiledTemplate.id);
if (isBlank(result)) {
var templateData = compiledTemplate.getData(this._appId);
result =
new AppProtoView(templateData.commands, ViewType.HOST, true,
templateData.changeDetectorFactory, null, new ProtoPipes(new Map()));
var emptyMap: {[key: string]: PipeBinding} = {};
result = new AppProtoView(templateData.commands, ViewType.HOST, true,
templateData.changeDetectorFactory, null, new ProtoPipes(emptyMap));
this._cache.set(compiledTemplate.id, result);
}
return result;