use*_*915 1 typescript angular
我正在使用 Typescript 学习 Angular 2。我遇到了一个让我很困惑的例子。来了
在
组件.ts
getValidation(state:any, thingName?: string) {
let thing: string = state.path || thingName;
let messages : string[] = [];
messages.push(`You must enter a **${thing}**`);
}
Run Code Online (Sandbox Code Playgroud)
在上面的例子中使用$and有什么意义{},直到现在我总是使用this.thing来使用任何变量?
| 归档时间: |
|
| 查看次数: |
1341 次 |
| 最近记录: |