Confirmation on Leaving the Current Page in an Angular.js App
来源:互联网 发布:网络布线是做什么的 编辑:程序博客网 时间:2024/06/07 07:22
diagnostic_module.controller("SpeakerCtrler", ["$scope", "$http", function ($scope, $http) { $scope.isTesting = false; $scope.$on('$locationChangeStart', function( event ) { var answer = confirm("Are you sure you want to leave this page?") if (!answer) { event.preventDefault(); } else { if($scope.isTesting) { $http.delete('/api/diagnostics/speaker'). success(function () { $scope.isTesting = false; }); } } }); $scope.onStartSubmit = function() { $http.post('/api/diagnostics/speaker'). success(function () { $scope.isTesting = true; }); }; $scope.onStopSubmit = function() { $http.delete('/api/diagnostics/speaker'). success(function () { $scope.isTesting = false; }); };}]);
0 0
- Confirmation on Leaving the Current Page in an Angular.js App
- Detect leaving a page in AngularJS
- How to execute an OS command in SQL*PLUS without leaving the session ?
- Highlighting the Current Page in a Navigating Bar
- get current url in current page
- The Login Page: Angular JS and Spring Security Part II
- Determine Current Page Shown In Master Page
- DoSave save the current page
- The file contains a character that cannot be represented in the current code page (936)
- warning C4819: The file contains a character that cannot be represented in the current code page
- VSE: The file contains a character that cannot be represented in the current code page (936).
- warning C4819: The file contains a character that cannot be represented in the current code page
- warning C4819: The file contains a character that cannot be represented in the current code page
- warning C4819: The file contains a character that cannot be represented in the current code page
- Summary on 20080716: close the current page through backend bean method
- device unauthorized. Please check the confirmation dialog on your device.
- An application error occurred on the server. The current custom error settings for this application
- How to set the current user on the model instance in the admin:
- 二叉树的层次遍历
- 新版本caffe脚本运行无权限,#!/usr/bin/env sh
- UVA 1635 Irrelevant Elements
- 内存泄漏检查工具valgrind的安装与使用
- jquery选择器
- Confirmation on Leaving the Current Page in an Angular.js App
- Activity生命周期
- 总结
- CSS Hack技术介绍及常用的Hack技巧集锦
- hdcpc
- androidstudio--gsonformat--超爽的数据解析方式
- Swift学习笔记(十二)构造过程
- 第四章 变量、作用域和内存问题
- CodeForces 560A Currency System in Geraldion