了解 : angular ng-messages

ng-messages="form['positionTitle' + languageVersion.typeEnum].$error

ng-messages="form.positionTitle{{languageVersion.typeEnum}}.$error

以上2个的表达式只有第1行可以,所以之后ng-messages都这么做。

为什么不全部都follow第1行的?因为读的时候不容易,理解javascript会误会,毕竟是angular 表达式。暂时先用容易读的方式来写

原文地址:https://www.cnblogs.com/stooges/p/4888337.html