this.injectedProps must be an object

This commit is contained in:
fand
2017-11-02 12:19:15 +09:00
parent 192d590c82
commit 225b37ec26
+5 -2
View File
@@ -27,10 +27,13 @@ export function react2angular<Props>(
return {
bindings: fromPairs(names.map(_ => [_, '<'])),
controller: ['$element', ...injectNames, class extends NgComponent<Props> {
injectedProps: any[];
injectedProps: { [name: string]: any }
constructor(private $element: IAugmentedJQuery, ...injectedProps: any[]) {
super()
this.injectedProps = injectedProps;
this.injectedProps = {}
injectNames.forEach((name, i) => {
this.injectedProps[name] = injectedProps[i]
})
}
render() {
// TODO: rm any when https://github.com/Microsoft/TypeScript/pull/13288 is merged