📜  angularjs 你确定要离开 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:50.137000             🧑  作者: Mango

代码示例1
$scope.$on('$locationChangeStart', function( event ) {
    var answer = confirm("Are you sure you want to leave this page?")
    if (!answer) {
        event.preventDefault();
    }
});