差的B / W NG-模型和数据-NG-模型 [英] difference b/w ng-model and data-ng-model
本文介绍了差的B / W NG-模型和数据-NG-模型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我新学的角度JS你能说NG-模型和数据-NG-模式的区别
<! -
名字:<输入类型=文本NG模型=FNAMEID =FNAME>
第二名称:LT;输入类型=文本NG模型=lname的ID =lname的>
- >
解决方案
最佳实践:使用破折号分隔的格式preFER(例如NG绑定的ngBind)。 如果您要使用HTML验证工具,可以改用数据 - prefixed版本(例如数据-NG-绑定的ngBind)。上面显示的其他形式接受遗留原因但我们建议您避开他们。
I am newly learned the angular js can you say the difference between ng-model and data-ng-model
<!--
First Name : <input type="text" ng-model="fname" id="fname">
Second Name : <input type="text" ng-model="lname" id="lname">
-->
解决方案
Best Practice: Prefer using the dash-delimited format (e.g. ng-bind for ngBind). If you want to use an HTML validating tool, you can instead use the data-prefixed version (e.g. data-ng-bind for ngBind). The other forms shown above are accepted for legacy reasons but we advise you to avoid them.
这篇关于差的B / W NG-模型和数据-NG-模型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文