the form added asynchronously does not work as usual. How should I validate it? The following is part of the code
//
<div class="preview" ng-controller="fbWorkController">
<div class="content-view">
<form fb-form="previewForms" name="newForm"></form>
<button class="btn btn-lg btn-white"></button>
<button class="btn btn-lg btn-success" ng-disabled="newForm.$invalid" ng-click="saveFormData()">{{newForm.$invalid}}</button>
</div>
</div>
//fb-form
angular.module("builder.directive", []).directive("fbForm", [function () {
return {
restrict: "A",
require: "ngModel",
scope: {
data: "=ngModel",
forms: "=fbForm"
},
template: "<div ng-repeat="component in forms.components"><div fb-form-object="component"></div></div>"
};
}])
//
<div class="nav-view form-group">{{component.title}}</div>
<div class="view form-group" ng-class="{"fb-hidden": component.properties.visible=="hidden"}">
<label for="{{component.properties.overrideId}}" class="control-label" ng-class="{"required":component.properties.required}">{{component.properties.label}}</label>
<div class="">
<input type="hidden" fb-dynamic-model="component.properties.overrideId" fb-dynamic-model-pre="data" validator-required="{{component.properties.required}}" validator="{{component.properties.validation}}">
<input type="text" class="form-control" id="{{component.properties.overrideId}}" ng-model="component.value"
ng-disabled="component.properties.visible=="disabled"" ng-readonly="component.properties.visible=="readonly""
placeholder="{{component.properties.placeholder}}" ng-style="component.properties.style">
</input>
<p class="help-block">{{component.properties.description}}
</div>
</div>