Skip to content
Loading
it did not show the content of my second row even if i put the static content like instead of recipe.name i type string name even than it is not showing , but it shows the first row data and content .
 
below is my model class
  1. export class Recipe{  
  2. public name:string;  
  3. public description:string;  
  4. public imagePath:string;  
  5. constructor(name:string,desc:string,imagepath:string){  
  6. this.name=name;  
  7. this.description=desc;  
  8. this.imagePath=imagepath;  
  9. }  
  10. }  
and my recipe -list component.ts is below
  1. import { Component, OnInit } from '@angular/core';  
  2. import { Recipe } from '../recipe.model';  
  3.   
  4. @Component({  
  5. selector: 'app-recipe-list',  
  6. templateUrl: './recipe-list.component.html',  
  7. styleUrls: ['./recipe-list.component.css']  
  8. })  
  9. export class RecipeListComponent implements OnInit {  
  10. recipes:Recipe[]=[  
  11. new Recipe('this is test recipe','this is its description','https://cdn.pixabay.com/photo/2016/06/15/19/09/food-1459693_960_720.jpg')  
  12. ];  
  13. constructor() { }  
  14. ngOnInit() {  
  15. }  
  16. }