I am learning Angular 2 and I am getting a strange error:
ERROR in [default] /home/szabo/PhpstormProjects/recipe-book/src/app/recipes/recipe-list/recipe-item.component.ts:11:2 Unable to resolve signature of property decorator when called as an expression. Supplied parameters do not match any signature of call target.
Here is my "model":
recipe.ts
export class Recipe {
constructor(public name, public description, public imagePath) {
}
}
Here is my 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() {
}
}
What could be the problem? Thanks.
Your model isn't the problem here, you are missing () on @Input decorator:
@Input() recipe: Recipe;
Read more about Input here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With