I am trying to remove an input element which was added dynamically into a form.
I am using the below code for this.
var MyEle = angular.element(document.getElementById('testID'));
MyEle.remove();
and the input element is added dynamically as below
<ng-form name="TestForm" novalidate">
<div class="testData">
<input type="text" name="FirstName1" ng-model="FirstName1" ng-required="true"/>
<input type="text" id="testID" name="FirstName2" ng-model="FirstName2" ng-required="true"/>
</div>
</ng-form>
The above code is removing the element but still the form is showing invalid even after entering the data into First Input(FirstName1) element.
It seems the removal process is not yet completed. It is not removing from the form. but I am not able to see it on the page.
ng-ifofng-hide