Angular: DOM Manipulation in $uibModal

Viewed 940

I am creating modal dialog with UI Bootstrap for Angular, this is the HTML template for the modal:

<div class="modal-content">
  <div class="modal-body">
      ...
  </div>
  <div class="modal-footer">
      <button class="btn btn-primary" ng-click="save();">Save</button>
  </div>
</div>

And this is the controller for the modal directive:

app.controller('modalCtrl', [
    '$scope', function ($scope) {
        return $scope.save = function () {
            ...
        };
    }
]);

Calling it with this:

$uibModal.open({
    templateUrl: '...',
    controller: 'modalCtrl'
});

When the save button clicked, I need change the button styling / animation using another 3rd party library which basically is something like this:

button.loading();

What is the ideal way to do this? I know many people say directive is the way to do DOM manipulation, but how can we do it in here?

1 Answers
Related