augdog97
augdog97

Reputation: 267

My array of Products dont render on Angular using the products-list component

I built out a simple app using Angular and I am using a model, inputs, and outputs. I finished the project, but when I go to serve the app nothing renders on the page. On Chrome dev tools I find that that there is nothing under the "products-list" component when you go down the DOM tree on the elements tab. This tells me there is no data getting passed in, but I am not sure why. There is a good amount of code so below is the link to the Github project. Any help or guidance is much appreciated. link: https://github.com/augdog97/Inventory-Angular

Upvotes: 0

Views: 117

Answers (2)

augdog97
augdog97

Reputation: 267

To be honest I am not sure what the issue was at all. I would make new test components with just text and they would not render. I ended up just making a new project and copying the code over and making new components and it works just fine.

Upvotes: 0

Victor Martinez Calvo
Victor Martinez Calvo

Reputation: 2445

My first suggestion: 1 - Try to avoid any kind of initialization in the constructor() of your components. You are doing in your app.component.ts Initialize this.products in the “ngOnInit” method and implement “onInit” in your app.component.ts 2 - You are implementing Objects, but just an Interface would suffice in this case since your “model” is very basic. Try and tell us. Any error or warning in the Console?

Upvotes: 1

Related Questions