I think the below does make more sense and is working the same way:

```
        $scope.$watch('response', function(newVal, oldVal) {
          if (newVal) {
            var success = $scope.response == 'success';
            $scope.feedbackSuccessModalShown = success;
            $scope.feedbackErrorModalShown = !success;
            $scope.feedbackModalShown = false;
          }
        });

        // We need to reset "response" to undefined when the modals are closed
        // by the user. This is to be notified again when the "response" state
        // changes again.
        $scope.$watch('feedbackSuccessModalShown', function(newVal, oldVal) {
          $scope.response = undefined;
        });
        $scope.$watch('feedbackErrorModalShown', function(newVal, oldVal) {
          $scope.response = undefined;
        });
```