简体   繁体   English

Angular 2 NgModel与输入和事件

[英]Angular 2 NgModel vs Inputs and Events

Can I use NgModel for interaction of the components or use only inputs and events ? 我可以使用NgModel进行组件交互还是仅使用输入事件

NgModel should only be used in forms? NgModel应该仅以表格形式使用吗?

ngModel can be used when a ControlValueAccessor is provided for components. 为组件提供ControlValueAccessor时可以使用ngModel Angular provides ControlValueAccessor implementation for <input> elements out of the box. Angular提供了<input>元素的ControlValueAccessor实现。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM