{"id":15696081,"url":"https://github.com/patrickjs/angular-beforeunload","last_synced_at":"2025-12-12T04:01:15.702Z","repository":{"id":10836609,"uuid":"13115516","full_name":"PatrickJS/angular-beforeunload","owner":"PatrickJS","description":"Angular.js service for onBeforeUnload","archived":false,"fork":false,"pushed_at":"2013-12-04T18:45:54.000Z","size":133,"stargazers_count":7,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-02T22:48:59.948Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PatrickJS.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-09-26T07:19:16.000Z","updated_at":"2023-04-13T14:26:57.000Z","dependencies_parsed_at":"2022-09-03T00:00:18.504Z","dependency_job_id":null,"html_url":"https://github.com/PatrickJS/angular-beforeunload","commit_stats":null,"previous_names":["gdi2290/angular-beforeunload"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PatrickJS%2Fangular-beforeunload","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PatrickJS%2Fangular-beforeunload/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PatrickJS%2Fangular-beforeunload/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PatrickJS%2Fangular-beforeunload/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PatrickJS","download_url":"https://codeload.github.com/PatrickJS/angular-beforeunload/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253156168,"owners_count":21862837,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T19:07:14.913Z","updated_at":"2025-12-12T04:01:14.813Z","avatar_url":"https://github.com/PatrickJS.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# angular-beforeunload [![Build Status](https://travis-ci.org/gdi2290/angular-beforeunload.png?branch=master)](https://travis-ci.org/gdi2290/angular-beforeunload)\nConfirm dialog pop up if they try and (or accidently click away from) the page.\n\nYou can download angular-beforeunload by:\n\n* (prefered) Using bower and running `bower install angular-beforeunload --save`\n* Using npm and running `npm install angular-beforeunload --save`\n* Downloading it manually by clicking [here to download development unminified version](https://raw.github.com/gdi2290/angular-beforeunload/master/angular-beforeunload.js)\n\n\n```javascript\nangular.module('YOUR_APP', [\n  'angular-onbeforeunload'\n])\n  .controller('MainCtrl', function(onBeforeUnload) {\n    // Bind a listener on your current $scope and save reference to it.\n    var onbeforeunload = $scope.$on('$locationChangeStart', BeforeUnload.init('TOP_MESSAGE', 'BOTTOM_MESSAGE'))\n    // In this controller the user will be prompted to\n    // confirm their choice before they change their location.\n    $scope.submitPage = function() {\n      // If you invoking your reference then your listener becomes null.\n      onbeforeunload();  \n    };\n    \n  });\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatrickjs%2Fangular-beforeunload","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpatrickjs%2Fangular-beforeunload","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatrickjs%2Fangular-beforeunload/lists"}