The value you pass to the "template" should be valid HTML and ideally should contain the appropriate CSS modal classes.
You may also need to transfer the scope of the controller.
var modalInstance = $modal.open({ scope:$scope, template: "<div>Message goes here...<button ng-click='cancel()'>Continue</button></div>", controller: function(){ $scope.cancel = function(){ alert("Cancelled"); }; } });
In general, I did not have to do this, but since you define the controller in an open method, this may be necessary. According to the docs, he should create a new area as a child of rootScope, but I suspect that your mileage is changing. I would like the instructions on the website to be a little more informative on this topic.
You can also try $ close and $ clean. I have never tried them, but since you are out of luck with a variable scope, this may be what you need.
MBielski
source share