
committed by
Miško Hevery

parent
ef9e40e82b
commit
14f0e9ada8
@ -146,8 +146,9 @@ class ProtoViewVisitor implements TemplateAstVisitor {
|
||||
var directiveIndex = new DirectiveIndex(this.boundElementCount - 1, directiveIndexAsNumber);
|
||||
var directiveMetadata = ast.directive;
|
||||
var outputsArray = [];
|
||||
StringMapWrapper.forEach(ast.directive.outputs, (eventName, dirProperty) => outputsArray.push(
|
||||
[dirProperty, eventName]));
|
||||
StringMapWrapper.forEach(
|
||||
ast.directive.outputs,
|
||||
(eventName: string, dirProperty: string) => outputsArray.push([dirProperty, eventName]));
|
||||
var directiveRecord = new DirectiveRecord({
|
||||
directiveIndex: directiveIndex,
|
||||
callAfterContentInit:
|
||||
|
@ -31,7 +31,7 @@ export abstract class CompileMetadataWithIdentifier {
|
||||
|
||||
abstract toJson(): {[key: string]: any};
|
||||
|
||||
get identifier(): CompileIdentifierMetadata { return unimplemented(); }
|
||||
get identifier(): CompileIdentifierMetadata { return <CompileIdentifierMetadata>unimplemented(); }
|
||||
}
|
||||
|
||||
export abstract class CompileMetadataWithType extends CompileMetadataWithIdentifier {
|
||||
@ -41,9 +41,9 @@ export abstract class CompileMetadataWithType extends CompileMetadataWithIdentif
|
||||
|
||||
abstract toJson(): {[key: string]: any};
|
||||
|
||||
get type(): CompileTypeMetadata { return unimplemented(); }
|
||||
get type(): CompileTypeMetadata { return <CompileTypeMetadata>unimplemented(); }
|
||||
|
||||
get identifier(): CompileIdentifierMetadata { return unimplemented(); }
|
||||
get identifier(): CompileIdentifierMetadata { return <CompileIdentifierMetadata>unimplemented(); }
|
||||
}
|
||||
|
||||
export class CompileIdentifierMetadata implements CompileMetadataWithIdentifier {
|
||||
@ -628,4 +628,4 @@ function objFromJson(obj: any, fn: (a: {[key: string]: any}) => any): any {
|
||||
|
||||
function objToJson(obj: any): string | {[key: string]: any} {
|
||||
return (isString(obj) || isBlank(obj)) ? obj : obj.toJson();
|
||||
}
|
||||
}
|
||||
|
@ -234,7 +234,7 @@ class ProtoViewBuilderVisitor<APP_PROTO_VIEW, APP_PROTO_EL, STATEMENT> implement
|
||||
attrAsts: TemplateAst[]): string[][] {
|
||||
var attrs = visitAndReturnContext(this, attrAsts, {});
|
||||
directives.forEach(directiveMeta => {
|
||||
StringMapWrapper.forEach(directiveMeta.hostAttributes, (value, name) => {
|
||||
StringMapWrapper.forEach(directiveMeta.hostAttributes, (value: string, name: string) => {
|
||||
var prevValue = attrs[name];
|
||||
attrs[name] = isPresent(prevValue) ? mergeAttributeValue(name, prevValue, value) : value;
|
||||
});
|
||||
@ -330,12 +330,14 @@ class ProtoViewBuilderVisitor<APP_PROTO_VIEW, APP_PROTO_EL, STATEMENT> implement
|
||||
}
|
||||
|
||||
function mapToKeyValueArray(data: {[key: string]: string}): string[][] {
|
||||
var entryArray = [];
|
||||
StringMapWrapper.forEach(data, (value, name) => { entryArray.push([name, value]); });
|
||||
var entryArray: string[][] = [];
|
||||
StringMapWrapper.forEach(data,
|
||||
(value: string, name: string) => { entryArray.push([name, value]); });
|
||||
// We need to sort to get a defined output order
|
||||
// for tests and for caching generated artifacts...
|
||||
ListWrapper.sort(entryArray, (entry1, entry2) => StringWrapper.compare(entry1[0], entry2[0]));
|
||||
var keyValueArray = [];
|
||||
ListWrapper.sort<string[]>(entryArray, (entry1: string[], entry2: string[]) =>
|
||||
StringWrapper.compare(entry1[0], entry2[0]));
|
||||
var keyValueArray: string[][] = [];
|
||||
entryArray.forEach((entry) => { keyValueArray.push([entry[0], entry[1]]); });
|
||||
return keyValueArray;
|
||||
}
|
||||
|
@ -53,9 +53,9 @@ export class StyleCompiler {
|
||||
|
||||
private _loadStyles(plainStyles: string[], absUrls: string[],
|
||||
encapsulate: boolean): Promise<Array<string | any[]>> {
|
||||
var promises = absUrls.map((absUrl) => {
|
||||
var promises: Promise<string[]>[] = absUrls.map((absUrl: string): Promise<string[]> => {
|
||||
var cacheKey = `${absUrl}${encapsulate ? '.shim' : ''}`;
|
||||
var result = this._styleCache.get(cacheKey);
|
||||
var result: Promise<string[]> = this._styleCache.get(cacheKey);
|
||||
if (isBlank(result)) {
|
||||
result = this._xhr.get(absUrl).then((style) => {
|
||||
var styleWithImports = extractStyleUrls(this._urlResolver, absUrl, style);
|
||||
@ -66,7 +66,7 @@ export class StyleCompiler {
|
||||
}
|
||||
return result;
|
||||
});
|
||||
return PromiseWrapper.all(promises).then((nestedStyles: string[][]) => {
|
||||
return PromiseWrapper.all<string[]>(promises).then((nestedStyles: string[][]) => {
|
||||
var result: Array<string | any[]> =
|
||||
plainStyles.map(plainStyle => this._shimIfNeeded(plainStyle, encapsulate));
|
||||
nestedStyles.forEach(styles => result.push(styles));
|
||||
|
@ -505,7 +505,7 @@ class TemplateParseVisitor implements HtmlAstVisitor {
|
||||
sourceSpan: ParseSourceSpan,
|
||||
targetPropertyAsts: BoundElementPropertyAst[]) {
|
||||
if (isPresent(hostProps)) {
|
||||
StringMapWrapper.forEach(hostProps, (expression, propName) => {
|
||||
StringMapWrapper.forEach(hostProps, (expression: string, propName: string) => {
|
||||
var exprAst = this._parseBinding(expression, sourceSpan);
|
||||
targetPropertyAsts.push(
|
||||
this._createElementPropertyAst(elementName, propName, exprAst, sourceSpan));
|
||||
@ -517,7 +517,7 @@ class TemplateParseVisitor implements HtmlAstVisitor {
|
||||
sourceSpan: ParseSourceSpan,
|
||||
targetEventAsts: BoundEventAst[]) {
|
||||
if (isPresent(hostListeners)) {
|
||||
StringMapWrapper.forEach(hostListeners, (expression, propName) => {
|
||||
StringMapWrapper.forEach(hostListeners, (expression: string, propName: string) => {
|
||||
this._parseEvent(propName, expression, sourceSpan, [], targetEventAsts);
|
||||
});
|
||||
}
|
||||
@ -645,7 +645,7 @@ class TemplateParseVisitor implements HtmlAstVisitor {
|
||||
var allDirectiveEvents = new Set<string>();
|
||||
directives.forEach(directive => {
|
||||
StringMapWrapper.forEach(directive.directive.outputs,
|
||||
(eventName, _) => { allDirectiveEvents.add(eventName); });
|
||||
(eventName: string, _) => { allDirectiveEvents.add(eventName); });
|
||||
});
|
||||
events.forEach(event => {
|
||||
if (isPresent(event.target) || !SetWrapper.has(allDirectiveEvents, event.name)) {
|
||||
|
Reference in New Issue
Block a user