angularjs - How do I prompt a modal when the user leaves my website in Javascript/Angular? -
is there way in angular or javascript detect user leaving website (can closing browser or entering page) , prompt modal? in modal want ask user why leaving.
also, oke have this? website black listed due "annoying: feature?
with angular use
$scope.$on("$locationchangestart",function(){ //do stuff here });
to detect when user leaves page.
if use alert('your message');
, browser problably give user option block alerts site.
Comments
Post a Comment