Skip to content

Commit a7e6a89

Browse files
committed
Fixed bug applying input bindings in uiView component.
1 parent fc27f1c commit a7e6a89

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/directives/uiView.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ interface InputMapping {
6060
* @internal
6161
*/
6262
function ng2ComponentInputs<T>(mirror: ComponentMirror<T>): InputMapping[] {
63-
return mirror.inputs.map((input) => ({ prop: input.propName, token: input.templateName }));
63+
return mirror.inputs.map((input) => ({ prop: input.templateName, token: input.templateName }));
6464
};
6565

6666
/**
@@ -339,13 +339,6 @@ export class UIView implements OnInit, OnDestroy {
339339
const explicitBoundProps = Object.keys(bindings);
340340
const mirror = reflectComponentType(component);
341341

342-
// Returns the actual component property for a renamed an input renamed using `@Input('foo') _foo`.
343-
// return the `_foo` property
344-
const renamedInputProp = (prop: string) => {
345-
const input = mirror.inputs.find((i) => i.templateName === prop);
346-
return (input && input.propName) || prop;
347-
};
348-
349342
// Supply resolve data to component as specified in the state's `bindings: {}`
350343
const explicitInputTuples = explicitBoundProps.reduce(
351344
(acc, key) => acc.concat([{ prop: key, token: bindings[key] }]),
@@ -367,7 +360,7 @@ export class UIView implements OnInit, OnDestroy {
367360
.map(addResolvable)
368361
.filter((tuple) => tuple.resolvable && tuple.resolvable.resolved)
369362
.forEach((tuple) => {
370-
componentRef.setInput(tuple.resolvable.token, injector.get(tuple.resolvable.token));
363+
componentRef.setInput(tuple.prop, injector.get(tuple.resolvable.token));
371364
});
372365
}
373366
}

0 commit comments

Comments
 (0)