我不明白 angular2 网站上的这一段:
We threw in a diagnostic property at the end to return a JSON representation of our model. It'll help us see what we're doing during our development; we've left ourselves a cleanup note to discard it later.
什么意思
最佳答案
他们只是添加了一个 getter diagnostic
来获取模型作为字符串。然后他们将 {{diagnostic}}
添加到模板以使原始模型在测试表单时可见,以便在他们编辑表单时始终查看模型是否更新。
`{{model | json}}`
也会这样做。
关于 Angular 2 : What is diagnostic property in forms,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38115862/