I am currently facing an issue in angular2 (rc-1) where I am passing an array of strings to my function through component binding. However, when the array length exceeds 10, an error occurs:
Unsupported number of argument for pure functions: 11
This error seems a bit strange to me for two reasons:
- The array is supposed to be a single parameter.
- Why is there a limit on the number of function parameters? (the only reason that comes to mind is performance optimization to avoid using the
arguments
keyword.)
Here's how the component selector looks like:
<tb-infinite-scroll
[tbDataProperty]="[
'prop1',
'prop2',
'prop3',
'prop4',
'prop5',
'prop6',
'prop7',
'prop8',
'prop9',
'prop10',
'prop11'
]"></tb-infinite-scroll>
In the component itself:
@Component({
selector: 'tb-infinite-scroll',
inputs: [
'dataProp:tbDataProperty',
],
/*...*/
})
export class TbInfiniteScrollComponent {
public dataProp:any = '';
And within the component template:
<div *ngIf="sharedServices.typeOf(dataProp) === 'object'">
<div class="tb-infinite-scroll__cell" *ngFor="let prop of dataProp">{{row[prop]}}</div>
</div>
Here's the stack trace of the error:
browser_adapter.js:77 Error: Uncaught (in promise): Unsupported number of argument for pure functions: 11
at resolvePromise (zone.js:538)
at PromiseCompleter.reject (zone.js:515)
at eval (application_ref.js:295)
at ZoneDelegate.invoke (zone.js:323)
at Object.NgZoneImpl.inner.inner.fork.onInvoke (ng_zone_impl.js:45)
at ZoneDelegate.invoke (zone.js:322)
at Zone.run (zone.js:216)
at zone.js:571
at ZoneDelegate.invokeTask (zone.js:356)
at Object.NgZoneImpl.inner.inner.fork.onInvokeTask (ng_zone_impl.js:36)
Any insights on what might be causing this issue or any workarounds would be greatly appreciated.
Thank you in advance.