Git Product home page Git Product logo

Comments (5)

JeanMeche avatar JeanMeche commented on May 16, 2024

Hi, I'm not sure what the issue is. You're not handling an error, what would you expect ?

from angular.

alxhub avatar alxhub commented on May 16, 2024

We will definitely need a reproduction in Stackblitz in order to investigate further. I suspect whatever data library you're using is returning an object that isn't actually an Array (maybe a proxy?) [Symbol.iterator] should definitely be a function for any collection that @for supports.

from angular.

metalised avatar metalised commented on May 16, 2024

I'll see whether I can put one together. As noted it only seems to happen when using the response from the API.
Checking all the points through the code (browser debug console, console logging & dumping the JSON) shows it as an array.
The API endpoint is written in nest.js, so is also typescript based. I've hard-coded the data in the API to be an array to make sure that's what was being returned, but it still fails.

from angular.

metalised avatar metalised commented on May 16, 2024

@alxhub Based on your comment about a proxy I changed the code to use the API directly and it works. Seems to be something in how I've implemented ngrx/store which is causing the error.

Once I've found the problem I'll add a comment here in case anyone else comes across the same thing.

Thanks for the help.

from angular.

metalised avatar metalised commented on May 16, 2024

The issue was down to a typo in the definition of the initial state object.

Instead of "array: <Type[]>[];" it was "array: <Type[]>{};" so the initial value in the store was not an array type., causing the error.

from angular.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.