plunk: http://plnkr.co/edit/85Wl5W If I use the $modalInstance on the same controller(modalController.js), without being in a modal, angular gets frozen.
I just want to
Just write a function instead of creating new file:
$scope.yourModal= function (data) {
var modalInstance = $modal.open({
template: 'Do you really want to hurt me? ',
controller: function($scope, scope){
$scope = scope;
},
resolve: {
scope: function () {
return $scope;
}
},
size: 'sm'
});
}
$scope.hurt = function(data){
console.log(data);
}