Ronald91
Ronald91

Reputation: 1776

Is there a way to open a modal directly from a controller?

I have seen and have many examples of opening a modal on a ng-click but can I open a modal on the resolution of a $http get request? I have a plunker that I am trying to get the general idea here http://plnkr.co/edit/1XJUAP.

Upvotes: 0

Views: 86

Answers (1)

ruedamanuel
ruedamanuel

Reputation: 1930

You can do that by setting a call to your open() function in the success handler for the $http request

$http.get(url).success(function(data){ $scope.open();});

Upvotes: 1

Related Questions