{"id":17440475,"url":"https://github.com/twhitbeck/angular-click-outside","last_synced_at":"2025-10-14T09:04:34.811Z","repository":{"id":17228454,"uuid":"19997411","full_name":"twhitbeck/angular-click-outside","owner":"twhitbeck","description":"A simple directive to execute code when clicking outside of an element","archived":false,"fork":false,"pushed_at":"2018-09-24T21:11:16.000Z","size":11,"stargazers_count":5,"open_issues_count":1,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-19T19:54:23.743Z","etag":null,"topics":["angular","click","directive","outside"],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"dalingge/JD-Mobile","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/twhitbeck.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-05-20T21:01:12.000Z","updated_at":"2018-07-03T05:49:23.000Z","dependencies_parsed_at":"2022-07-21T19:48:29.696Z","dependency_job_id":null,"html_url":"https://github.com/twhitbeck/angular-click-outside","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twhitbeck%2Fangular-click-outside","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twhitbeck%2Fangular-click-outside/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twhitbeck%2Fangular-click-outside/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twhitbeck%2Fangular-click-outside/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/twhitbeck","download_url":"https://codeload.github.com/twhitbeck/angular-click-outside/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223881358,"owners_count":17219265,"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":["angular","click","directive","outside"],"created_at":"2024-10-17T14:49:17.600Z","updated_at":"2025-10-14T09:04:29.768Z","avatar_url":"https://github.com/twhitbeck.png","language":"HTML","readme":"angular-click-outside\n=====================\n\nA simple angular 1.x directive to execute code when clicking outside of an element\n\n### Get it\n`npm install angular-click-outside --save`\n\n### Use it\n* Include script in your html\n```html\n\u003cscript src=\"node_modules/angular-click-outside/angular-click-outside.js\"\u003e\u003c/script\u003e\n```\n\n* Add the `tw.directives.clickOutside` module to your module's list of dependencies:\n\n```js\nangular.module('app', ['tw.directives.clickOutside'])\n```\n\n* Use the `twClickOutside` directive.\n\n```html\n\u003cdiv class=\"menu\" tw-click-outside=\"hideMenu()\"\u003e\n...\n\u003c/div\u003e\n```\n\n#### Ignoring the event\nIf you don't want the `twClickOutside` to fire under certain circumstances (e.g. you don't need to hide the menu if it's already hidden), use the `ignoreIf` attribute:\n\n```html\n\u003cbutton ng-click=\"showMenu()\"\u003eShow Menu\u003c/button\u003e\n\u003cdiv class=\"menu\" tw-click-outside=\"hideMenu()\" ignore-if=\"menuAlreadyHidden()\"\u003e\n...\n\u003c/div\u003e\n```\n\nUse this to:\n* avoid side effects of `hideMenu()`\n* avoid cost of `hideMenu()` if it is more expensive to run than `menuAlreadyHidden()`\n\n#### Developing/testing\nUse `npm install \u0026\u0026 npm start` to open the example in your browser with live reloading via `browserSync`\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftwhitbeck%2Fangular-click-outside","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftwhitbeck%2Fangular-click-outside","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftwhitbeck%2Fangular-click-outside/lists"}