-
-
Notifications
You must be signed in to change notification settings - Fork 647
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
NG8: Type '{}' must have a '[Symbol.iterator]()' method that returns an iterator. #2080
Comments
That's not true... export class ProjectsComponent implements OnInit { ... <p-table |
However I cannot get it to work with returning a single row in this context. This is what I am doing now:
... I need onInit be cause id is a route parameter...
...
... But I really would prefer to use...
and
then...
Since I am pulling a single project. But I cannot get it to do that. Typescript barks at me :( |
Hi @sysmat, I found a solution for this issue on ChatGPT. The problem is that liveQuery returns an Observable that is not fully compatible with Angular's async pipe when used with directives like *ngFor. Here's the workaround: import { liveQuery } from "dexie";
import { from } from "rxjs";
import { map } from "rxjs/operators";
this.todoLists$ = from(
liveQuery(() => db.todoLists.toArray())
).pipe(
map(data => Array.isArray(data) ? data : []) // Ensure the output is an array
); |
@for
The text was updated successfully, but these errors were encountered: