ngx-viewer | Angular 8 directive for the Viewer.js library | Frontend Framework library
kandi X-RAY | ngx-viewer Summary
kandi X-RAY | ngx-viewer Summary
Angular 8+ directive for the Viewer.js library
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of ngx-viewer
ngx-viewer Key Features
ngx-viewer Examples and Code Snippets
Community Discussions
Trending Discussions on ngx-viewer
QUESTION
I've got a main component called DOCUMENT. This document takes a URL segment and fetches an array of associated objects from my database. Then, using @Output() documents = new EventEmitter()
and an @Input()
in a DOCUMENT VIEW component, I then iterate of the incoming array with *ngFor
. The whole thing works and the elements are displayed, but I keep getting the error
Error: Cannot find a differ supporting object '[object Object]' of type 'object'. NgFor only supports binding to Iterables such as Arrays.
I'm stumped. It feels like a typescript type error for some reason. I actually console.log the initial database return and indeed, it's an array of objects. So, unsure where this error is coming from
----------TS----------
...ANSWER
Answered 2019-Dec-01 at 08:26There is a problem with line @Output() documents = new EventEmitter();
.
You just need to pass a prop to child component. You don't need this, it is used to communicate some event from child to parent. What is happening here is, the first render happens with documents property as an Event Emitter object which leads to this *ngFor error and after you get the response it works fine in the second render.
You can remove this documents property assignment, it should work fine.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install ngx-viewer
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page