fix(compiler): emit correct types for literal arrays and maps.
This commit is contained in:
@ -159,7 +159,8 @@ export class CompileView implements NameResolver {
|
|||||||
proxyParams.push(new o.FnParam(paramName));
|
proxyParams.push(new o.FnParam(paramName));
|
||||||
proxyReturnEntries.push(o.variable(paramName));
|
proxyReturnEntries.push(o.variable(paramName));
|
||||||
}
|
}
|
||||||
createPureProxy(o.fn(proxyParams, [new o.ReturnStatement(o.literalArr(proxyReturnEntries))], new o.ArrayType(o.DYNAMIC_TYPE)),
|
createPureProxy(o.fn(proxyParams, [new o.ReturnStatement(o.literalArr(proxyReturnEntries))],
|
||||||
|
new o.ArrayType(o.DYNAMIC_TYPE)),
|
||||||
values.length, proxyExpr, this);
|
values.length, proxyExpr, this);
|
||||||
return proxyExpr.callFn(values);
|
return proxyExpr.callFn(values);
|
||||||
}
|
}
|
||||||
@ -178,7 +179,8 @@ export class CompileView implements NameResolver {
|
|||||||
proxyReturnEntries.push([entries[i][0], o.variable(paramName)]);
|
proxyReturnEntries.push([entries[i][0], o.variable(paramName)]);
|
||||||
values.push(<o.Expression>entries[i][1]);
|
values.push(<o.Expression>entries[i][1]);
|
||||||
}
|
}
|
||||||
createPureProxy(o.fn(proxyParams, [new o.ReturnStatement(o.literalMap(proxyReturnEntries))], new o.MapType(o.DYNAMIC_TYPE)),
|
createPureProxy(o.fn(proxyParams, [new o.ReturnStatement(o.literalMap(proxyReturnEntries))],
|
||||||
|
new o.MapType(o.DYNAMIC_TYPE)),
|
||||||
entries.length, proxyExpr, this);
|
entries.length, proxyExpr, this);
|
||||||
return proxyExpr.callFn(values);
|
return proxyExpr.callFn(values);
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<div>{{ctxProp}}</div>
|
<div [attr.array]="[0]" [attr.map]="{a:1}">{{ctxProp}}</div>
|
||||||
<form><input type="button" [(ngModel)]="ctxProp"/></form>
|
<form><input type="button" [(ngModel)]="ctxProp"/></form>
|
||||||
<my-comp *ngIf="ctxBool"></my-comp>
|
<my-comp *ngIf="ctxBool"></my-comp>
|
||||||
<div *ngFor="let x of ctxArr" [attr.value]="x"></div>
|
<div *ngFor="let x of ctxArr" [attr.value]="x"></div>
|
Reference in New Issue
Block a user