Research
Security News
Kill Switch Hidden in npm Packages Typosquatting Chalk and Chokidar
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
angular-click-outside-2
Advanced tools
A simple angular directive for executing code when clicking outside an element
A simple angular 1.x directive to execute code when clicking outside of an element
npm install angular-click-outside --save
<script src="node_modules/angular-click-outside/angular-click-outside.js"></script>
tw.directives.clickOutside
module to your module's list of dependencies:angular.module('app', ['tw.directives.clickOutside'])
twClickOutside
directive.<div class="menu" tw-click-outside="hideMenu()">
...
</div>
If 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:
<button ng-click="showMenu()">Show Menu</button>
<div class="menu" tw-click-outside="hideMenu()" ignore-if="menuAlreadyHidden()">
...
</div>
Use this to:
hideMenu()
hideMenu()
if it is more expensive to run than menuAlreadyHidden()
Use npm install && npm start
to open the example in your browser with live reloading via browserSync
FAQs
A simple angular directive for executing code when clicking outside an element
We found that angular-click-outside-2 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.