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:
@@ -81,7 +81,7 @@ var defaultLocale: string = 'en-US';
|
||||
@Pipe({name: 'date'})
|
||||
@Injectable()
|
||||
export class DatePipe implements PipeTransform {
|
||||
static _ALIASES = {
|
||||
static _ALIASES: {[key: string]: String} = {
|
||||
'medium': 'yMMMdjms',
|
||||
'short': 'yMdjm',
|
||||
'fullDate': 'yMMMMEEEEd',
|
||||
|
||||
@@ -14,7 +14,7 @@ import * as cd from 'angular2/src/core/change_detection/pipes';
|
||||
|
||||
export class ProtoPipes {
|
||||
static fromBindings(bindings: PipeBinding[]): ProtoPipes {
|
||||
var config = {};
|
||||
var config: {[key: string]: PipeBinding} = {};
|
||||
bindings.forEach(b => config[b.name] = b);
|
||||
return new ProtoPipes(config);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user