title: Disable button in angular js
body: <p>I have 2 buttons in my page "Save Set" &amp; "Load Set".
  "Save Set" button has ng-disabled=isSaveDisabled()</p>
  
  <pre><code>.....
  .controller('saveLoadSetToolbarBtn', ['$scope','$modal','propertiesModified',
      function ($scope,$modal,propertiesModified) {
                    $scope.loadTuneSet = function () {
  
              $modal.open({
                  templateUrl: 'loadSetDlg.html',
                  controller: 'loadSetCtrl'
              });
          };
  
          $scope.isSaveDisabled = function() {
              return !propertiesModified.get();
          };
  
  .......
  </code></pre>
  
  <p>When I click Load Set, it will open a popup and their I'll have OK button. On this click, I should disable the "Save Set" button</p>
  
  <p>OK Button,</p>
  
  <pre><code>.controller('loadSetCtrl', ['$scope', '$modalInstance', 'generalDataService',
      function ($scope, $modalInstance, generalDataService) {
  
  
          $scope.items = [];
          $scope.selectedSet = undefined;
  
          $scope.ok = function () {                
              //doing some logic
              closeDialog();
              $modalInstance.close();
          };
  </code></pre>
  
  <p>If any value changes happen in my page then this "Save Set" button will be enabled. problem is if I change any value in my page this button is enabling (as expected). If I click "Load Set" button, popup will open and on OK button click (available on Popup) then this "Save Set" should go back to Disable state. I should be able to return boolean value true through this isSaveDisabled function on OK button click.</p>