Why ng-show directive doesn't work? (Angular JS)

Viewed 23

For some reason, the ng-show and ng-hide directives completely refuse to work for me. Here is the source code:

<div
  class="list row"
  ng-app="contactListComponent"
  ng-controller="showController"
>
  <div class="col-md-6">
    <button
      class="m-3 btn btn-sm btn-danger"
      ng-click="showElement = !showElement"
    >
      Remove All</button
    ><input class="input-group" ng-show="showElement" />
  </div>
</div>
<script>
  var showApp = angular
    .module("contactListComponent", [])

    .controller("showController", function ($scope) {
      $scope.showElement = false;
    });
</script>

What am I doing wrong?

0 Answers
Related