我正在使用带有UI路由器的Angular UI modal。当我取消模态时,状态不会退出。相反,它仍然活跃。如果我删除或保存模态,则正确退出状态。关于如何在简单地解雇模态时退出模态的任何建议?
路由器
editProject.cancel = function () {
$modalInstance.dismiss('cancel');
// State still remains active here
};
editProject.destroy = function () {
$modalInstance.close(editProject.selected);
editProject.project.$remove(editProject.project).then(function (data) {
});
};
editProject.save = function () {
$modalInstance.close(editProject.selected);
editProject.project.$save(editProject.project).then(function (data) {
// . . .
});
};
控制器:
{{1}}