the documentation for
ng-bootstrap
并注意到
one of their examples
在对象文字定义中省略逗号。(我无法直接链接到Plunker中的文件,但这是第30行。)
src/app.ts
.)
@NgModule({
imports: [BrowserModule, FormsModule, ReactiveFormsModule, JsonpModule, NgbModule.forRoot()],
declarations: [App, NgbdDropdownManual]
bootstrap: [App]
})
export class AppModule {}
这让我开始使用Plunk,结果是可以删除对象声明中的所有逗号,代码仍在编译和运行——尝试添加
console.log({a:1 b:2})
明白我的意思。
这在所有TypeScript中都得到了正式支持吗?或者这是这个特定示例中代码编译和运行方式的产物吗?