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

Popular posts from this blog

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

java - Log4j2 configuration not found when running standalone application builded by shade plugin -

python - How do I create a list index that loops through integers in another list -