【发布时间】:2017-03-05 14:48:04
【问题描述】:
我正在学习 Angular 2,但遇到一个奇怪的错误:
[默认] /home/szabo/PhpstormProjects/recipe-book/src/app/recipes/recipe-list/recipe-item.component.ts:11:2 中的错误 当作为表达式调用时,无法解析属性装饰器的签名。 提供的参数与调用目标的任何签名都不匹配。
这是我的“模型”:
recipe.ts
export class Recipe {
constructor(public name, public description, public imagePath) {
}
}
这是我的 RecipeItemComponent:
import {Component, OnInit, Input} from '@angular/core';
import { Recipe } from '../recipe';
@Component({
selector: 'app-recipe-item',
templateUrl: './recipe-item.component.html',
styleUrls: ['./recipe-item.component.css']
})
export class RecipeItemComponent implements OnInit {
@Input recipe: Recipe; //line 11
recipeId: number;
constructor() { }
ngOnInit() {
}
}
可能是什么问题? 谢谢。
【问题讨论】:
标签: angular components