-2
對象結構中使用符合通話對象的任何簽名看起來像如下:提供的參數不打字稿與角2
export class Recipe {
public name: string;
public description: string;
public imagePath: string;
constructorn(name: string, desc: string, imagePath: string) {
this.name = name;
this.description = desc;
this.imagePath = imagePath;
}
}
我的調用語句:
export class RecipeListComponent implements OnInit {
recipes: Recipe[] = [
new Recipe('Test Recipe', 'This is simply a test',
'https://cdn.pixabay.com/photo/2016/06/15/19/09/food-
1459693_960_720.jpg')
];
}
雖然我通過了所有該參數,但我仍然收到錯誤「提供的參數不匹配呼叫目標的任何簽名」
檢查你的拼寫。 – jonrsharpe