Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/AvraamMavridis/angular2-clickoutside-directive
Angular 2 directive that provides Click Outside Functionality
https://github.com/AvraamMavridis/angular2-clickoutside-directive
Last synced: about 1 month ago
JSON representation
Angular 2 directive that provides Click Outside Functionality
- Host: GitHub
- URL: https://github.com/AvraamMavridis/angular2-clickoutside-directive
- Owner: AvraamMavridis
- Created: 2016-10-01T11:43:43.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-08-06T14:27:07.000Z (over 6 years ago)
- Last Synced: 2024-10-28T11:39:02.531Z (about 2 months ago)
- Language: TypeScript
- Size: 28.3 KB
- Stars: 6
- Watchers: 3
- Forks: 1
- Open Issues: 64
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-angular-components - angular2-clickoutside-directive - Angular 2 directive that provides Click Outside Functionality (Uncategorized / Uncategorized)
README
# angular2-clickoutside-directive
Angular 2 directive that provides Click Outside Functionality[![npm version](https://badge.fury.io/js/angular2-clickoutside-directive.svg)](https://badge.fury.io/js/angular2-clickoutside-directive)
[![forthebadge](http://forthebadge.com/images/badges/built-with-love.svg)](http://forthebadge.com)
## Install
`npm i angular2-clickoutside-directive --save`
### Import the directive to your project and use it in your Component defining an event handler
```typescript
import { ClickOutsideDirective } from 'angular2-clickoutside-directive';@Component({
selector: 'my-app',
template : `
A button
`,
directives : [ ClickOutsideDirective ]
} )
class MyFirstComponent implements OnInit {
constructor(){}onClickOutside($event)
{
console.log('Clicked outside')
}ngOnInit(){}
}
```
### ContributeAny pull-request is more than welcome :boom: :smile:
This project adheres to the Contributor Covenant [code of conduct](http://contributor-covenant.org/). By participating, you are expected to uphold this code.
### License
MIT