Form-generator

Change handling of labelBind in form generator. It now adds ng-bind directive to a <span> element inside <label> rather than to <label> directly. This stops Angular from wiping out anything else we may want to add inside <label> like help icon.
This commit is contained in:
Chris Houseknecht 2014-07-30 16:30:49 -04:00
parent 22f7dfce67
commit 7093e95011

View File

@ -530,7 +530,6 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'Utilities', 'ListGenerator
var html = '';
if (field.label || field.labelBind) {
html += "<label ";
html += (field.labelBind) ? "ng-bind=\"" + field.labelBind + "\" " : "";
if (horizontal || field.labelClass) {
html += "class=\"";
html += (field.labelClass) ? field.labelClass : "";
@ -540,7 +539,11 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'Utilities', 'ListGenerator
html += (field.labelNGClass) ? "ng-class=\"" + field.labelNGClass + "\" " : "";
html += "for=\"" + fld + '">';
html += (field.icon) ? Icon(field.icon) : "";
html += "<span class=\"label-text\">" + field.label + "</span>";
if (field.labelBind) {
html += "<span class=\"label-text\" ng-bind=\"" + field.labelBind + "\"></span>";
} else {
html += "<span class=\"label-text\">" + field.label + "</span>";
}
html += (field.awPopOver && !field.awPopOverRight) ? Attr(field, 'awPopOver', fld) : "";
html += "</label>\n";
}