0
嗨,我動態添加基於引導類型選擇的數據類型的元素。因爲總是刪除html元素並添加新的問題。表單錯誤集合仍然保持以前的錯誤,並顯示單個html元素的多個錯誤。請幫助這裏有什麼不對。動態渲染元素角形
var addDynamicControl = function (fieldInformation) {
if (angular.element("#" + scope.advanceSearchItem.searchItemIndex).length) {
angular.element("#" + scope.advanceSearchItem.searchItemIndex).remove();
if (ctrl.advanceSearchForm[fieldInformation.SearchCriteriaName])
ctrl.advanceSearchForm[fieldInformation.SearchCriteriaName].$setValidity("required", false);
}
var angularForm = angular.element("#" + scope.formName);
var result = angularForm.append(getTemplateByType(fieldInformation));
$compile(result)(scope);
};