All Projects → NetanelBasal → ngx-event-modifiers

NetanelBasal / ngx-event-modifiers

Licence: other
Event Modifiers for Angular Applications https://netbasal.com/implementing-event-modifiers-in-angular-87e1a07969ce

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to ngx-event-modifiers

preact-delegate
Preact delegate DOM events
Stars: ✭ 17 (+21.43%)
Mutual labels:  events, dom
Ngx Meta
Dynamic page title & meta tags utility for Angular (w/server-side rendering)
Stars: ✭ 331 (+2264.29%)
Mutual labels:  dom, angular2
ngx-stop-propagation
✋ Stop propagation for everyday events with Angular directives 🎩
Stars: ✭ 13 (-7.14%)
Mutual labels:  events, stoppropagation
Nanocomponent
🚃 - create performant HTML components
Stars: ✭ 355 (+2435.71%)
Mutual labels:  events, dom
Domtastic
Small, fast, and modular DOM and event library for modern browsers.
Stars: ✭ 763 (+5350%)
Mutual labels:  events, dom
Bliss
Blissful JavaScript
Stars: ✭ 2,352 (+16700%)
Mutual labels:  events, dom
Vent
jQuery inspired DOM events library
Stars: ✭ 30 (+114.29%)
Mutual labels:  events, dom
ng2-events
Supercharge your Angular2+ event handling
Stars: ✭ 17 (+21.43%)
Mutual labels:  events, angular2
PoShLog
🔩 PoShLog is PowerShell cross-platform logging module. It allows you to log structured event data into console, file and much more places easily. It's built upon great C# logging library Serilog - https://serilog.net/
Stars: ✭ 108 (+671.43%)
Mutual labels:  events
login-form-angular2
A simple login form using the angular2 material design and the angular-CLI.
Stars: ✭ 21 (+50%)
Mutual labels:  angular2
ng-leaflet
Angular 2 component for Leaflet 1.x (WIP - Help Wanted)
Stars: ✭ 16 (+14.29%)
Mutual labels:  angular2
wikift
enterprise level wikift is open source wiki system.
Stars: ✭ 308 (+2100%)
Mutual labels:  angular2
site
Sources of euregjug.eu
Stars: ✭ 26 (+85.71%)
Mutual labels:  events
openpics
Search and download free stock photos from multiple sources for your creative project
Stars: ✭ 31 (+121.43%)
Mutual labels:  angular2
event-emitter
Event Emitter module for Nest framework (node.js) 🦋
Stars: ✭ 102 (+628.57%)
Mutual labels:  events
cheatsheets
📋 Various cheatsheets made while working as a developer
Stars: ✭ 22 (+57.14%)
Mutual labels:  dom
awesome-angular
💖 A list of awesome Angular (2️⃣➕) resources
Stars: ✭ 61 (+335.71%)
Mutual labels:  angular2
ui-grid-angular2
ui-grid in Angular 2
Stars: ✭ 35 (+150%)
Mutual labels:  angular2
move-into-view
move-into-view is such as sroll-into-view but better
Stars: ✭ 33 (+135.71%)
Mutual labels:  dom
zebrajs
A modular, jQuery compatible, ultra light-weight JavaScript micro-library for modern browsers
Stars: ✭ 26 (+85.71%)
Mutual labels:  dom

Build Status

Event Modifiers for Angular Applications (inspired by Vue)

Installation

To install this library, run:

$ npm install ngx-event-modifiers --save
import { EventModifiersModule } from 'ngx-event-modifiers';

@NgModule({
  imports: [
    EventModifiersModule
  ]
})
export class AppModule { }

Usage

  • (click.stop) - The click event's propagation will be stopped
  <button (click.stop)="onClick($event, extraData)">Click Me!!</button>
  • (click.prevent) - The submit event will no longer reload the page
  <button (click.prevent)="onClick($event, extraData)" type="submit">Click Me!!</button>
  • (click.self) - Only trigger handler if event.target is the element itself i.e. not from a child element
  <div (click.self)="onClick($event, extraData)">
    <button>Click Me!!</button>
  </div>
  • (click.once) - The click event will be triggered at most once
  <button (click.once)="onClick($event, extraData)">Click Me!!</button>
  • (click.outside) - The click event will be triggered only if clicked outside the current element
  <div>
    <button (click.outside)="onClick($event, extraData)">Click Me!!</button>
  </div>

You can also pass [eventOptions]:

  <div (click.self)="onClick($event, extraData)"
       [eventOptions]="{preventDefault: true, stopProp: true}">
     <button>Click Me!!</button>
  </div>

License

MIT © Netanel Basal

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].