我正在学习Angular 2,我收到一个奇怪的错误:
ERROR in [default] /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) {
}
}
Run Code Online (Sandbox Code Playgroud)
这是我的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() {
}
}
Run Code Online (Sandbox Code Playgroud)
可能是什么问题呢?谢谢.
我将语言环境设置为'ro'现在工作日是罗马尼亚语。但是,我也设置了
week : {
dow : 1
}
Run Code Online (Sandbox Code Playgroud)
并moment.weekdays()返回'en'从星期日开始的天数。为什么会这样?
以此功能为例:
public static int[] mergeSort(int[] array, int lo, int hi) {
if (lo == hi) {
return array;
}
int mid = (lo + hi) / 2;
mergeSort(array, lo, mid);
mergeSort(array, mid, hi);
merge(array, lo, mid + 1, hi);
return array;
}
Run Code Online (Sandbox Code Playgroud)
正如你所看到的那样merge,我想在我的测试中模拟这个函数.有可能的?