Difference between ng-model and data-ng-model

后端 未结 4 1085
谎友^
谎友^ 2020-12-29 19:50

I am new with the AngularJs. Can anyone say the difference between ng-model and data-ng-model?

With ng-model

First          


        
4条回答
  •  春和景丽
    2020-12-29 20:39

    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.

提交回复
热议问题