One of my DOM
elements is structured like this:
<div data-ng-if="allControllerFieldsAreProvided($index)" class="test-controller-connection">
<a href="" ng-click="fetchUsersFromDataSource($index, 10)">Test Connection</a>
</div>
This specific function appears as follows:
$scope.allControllerFieldsAreProvided = function (adSetupIndex) {
return $scope.activeDirectoryConfiguration.activeDirectorySetups[adSetupIndex].name.length > 0 &&
$scope.activeDirectoryConfiguration.activeDirectorySetups[adSetupIndex].activeDirectoryDataSource.host.length > 0 &&
$scope.activeDirectoryConfiguration.activeDirectorySetups[adSetupIndex].activeDirectoryDataSource.port.length > 0 &&
$scope.activeDirectoryConfiguration.activeDirectorySetups[adSetupIndex].activeDirectoryDataSource.userName.length > 0 &&
$scope.activeDirectoryConfiguration.activeDirectorySetups[adSetupIndex].activeDirectoryDataSource.password.length > 0;
};
Initially, the DOM
element is hidden when there is no input. However, once all inputs are provided, the element becomes visible.
The Issue
The trouble arises when any of the inputs are deleted afterward (e.g., text removed from an input box). In such cases, the DOM
element should disappear, but it does not.
How can I resolve this issue?