I use a button to hide/show (toggle) a div:
HTML
<button type="button" ng-click="toggleBuilder()" class="btn btn-primary">Hide Div queryBuilder</span></button>
<input type="text" class="form-control" id="searchField" ng-model="output"/>
<div class="queryBuilder" ng-hide="builder"></div>
JS
$scope.builder = true;
$scope.toggleBuilder = function() {
$scope.builder = $scope.builder === false ? true : false;
};
Now I would like to achieve that if the DIV is hidden, the input has no binding with the "output". If the DIV is shown, the input should have the binding with "output".
Thank you for your tips
outputanyway?{{output}}between the div tags, that should do the trick$scope.builder = $scope.builder === false ? true : false;to just$scope.builder = !$scope.builder;