I am looking through the angular ui bootstrap documentation and finally found a solution.
The open method returns a modal instance , an object with an opened property:
opened - a promise that is resolved when the modal opens after loading the content template and resolving all variables
to call the function after opening the model.
$modalInstance.opened.then(function(){ alert('hi'); });
source share