Skip to content

Component throws console error in new installation #34

Open
@msorens

Description

@msorens

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions