Topic: Weird error with asynchronous data source

shellxsoftware priority asked 1 year ago

Expected behavior Basically i'm getting a weird error when trying to use an asynchronous data source for data tables.

Actual behavior Type 'any[] | null' is not assignable to type 'any[]'. Type 'null' is not assignable to type 'any[]'.ngtsc(2322)

Resources (screenshots, code snippets etc.) See above ^

Arkadiusz Idzikowski staff commented 1 year ago

@shellxsoftware Could you please provide a simple TS code example so we can reproduce that on our end?

shellxsoftware priority commented 1 year ago

it's basically just in the screenshot, one line of code.

@shellxsoftware Please try to disable type checking for this input:

[dataSource]="$any(dataSource$ | async)"

You may also need to initialize the dataSource value in ts file:

dataSource$: Observable<any[]> = of([]);

We will check what we can do to resolve this problem on our end.

Edit: This problem was fixed in v1.6.0

Please insert min. 20 characters.


Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.



Specification of the issue

  • User: Priority
  • Premium support: Yes
  • Technology: MDB Angular
  • MDB Version: MDB5 1.3.0
  • Device: --
  • Browser: --
  • OS: --
  • Provided sample code: No
  • Provided link: Yes