I'm creating controls dynamically like
<div class="ctrlContainer" ng-repeat="c in Data.Controls">
<div class="divRow" ng-bind-
html="trustHTML(getTypeBasedHTML(c.HTMLControlType,Data.RootObjectName + '.'+
c.ModelName,c.NeedLabel,c.LabelText))"></div>
</div>
And my code is defined like
$scope.getTypeBasedHTML = function (type, ModelBinding, NeedLabel,
LabelText) {
var returnHtmltxt = ""
if (type == "text" || type == "number" || type == "email" || type ==
"date" || type == "checkbox" || type == "radio") {
if (NeedLabel)
returnHtmltxt += "<div class='divCell label-column'>" +
LabelText + "</div>"
returnHtmltxt += "<div class='divCell'><input type='" + type +
"' ng-model='" + ModelBinding + "' /></div>"
}
return returnHtmltxt
}
The above function is creating the control as expected and rendered into the page with "ng-model" properties, but when i'm changing values of the controls(input textboxes) the models are not updated in the scope. Can someone please look into this??!! Thanks
Note: The model that are bound to the dynamic elements are also dynamically created into the $scope