Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Component throws console error in new installation #34

Open
msorens opened this issue Mar 31, 2021 · 0 comments
Open

Component throws console error in new installation #34

msorens opened this issue Mar 31, 2021 · 0 comments

Comments

@msorens
Copy link

msorens commented Mar 31, 2021

I have tried building the simplest possible demo, lifting the data and template out of scroll.component.ts
from the od-vsstatic demo:

TEMPLATE

    <od-virtualscroll [vsData]="data$" [vsOptions]="options$">
      <ng-template let-item let-row="row" let-column="column">
        <span>Row: {{row}}</span><br>
        <span>Column: {{column}}</span>
        {{item}}
      </ng-template>
    </od-virtualscroll>

OBSERVABLES

  data$: Observable<number[]> = range(0, 100000).pipe(
      reduce((acc, cur) => { acc.push(cur); return acc; }, []));
  options$: Observable<IVirtualScrollOptions> =
    of({ itemWidth: 202, itemHeight: 202, numAdditionalRows: 1 });

When I run in the browser I get no rendered output and see this error in the console:

core.js:6162 ERROR TypeError: Cannot read property 'createComponent' of undefined
    at od-virtualscroll.js:622
    at ScanSubscriber.scanFunc [as accumulator] (od-virtualscroll.js:685)
    at ScanSubscriber._tryNext (scan.js:49)
    at ScanSubscriber._next (scan.js:42)
    at ScanSubscriber.next (Subscriber.js:49)
    at MergeMapSubscriber.notifyNext (mergeMap.js:70)
    at SimpleInnerSubscriber._next (innerSubscribe.js:10)
    at SimpleInnerSubscriber.next (Subscriber.js:49)
    at MapSubscriber._next (map.js:35)
    at MapSubscriber.next (Subscriber.js:49)

The source line being pointed to is this:

const newRow = this._viewContainer.createComponent(this._rowFactory)

Environment details:

  • Browser: Chrome
  • OS: macOS Big Sur
  • Angular: 11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant