kryops / ng2-events Goto Github PK
View Code? Open in Web Editor NEWSupercharge your Angular2+ event handling
Home Page: https://kryops.github.io/ng2-events/
License: MIT License
Supercharge your Angular2+ event handling
Home Page: https://kryops.github.io/ng2-events/
License: MIT License
My company uses this library mainly for the TouchEvent module. We found that on our iPads, after upgrading to iPadOs 13+, the (down) event would trigger our event handler twice. We did not see this behavior on our non-upgraded tablets. We also did not see this behavior on desktop.
iPadOs 13 brought Safari and some big changes to how iPadOs handles touch events and the 300ms delay.
WIth (up) and (down) we are currently able to deal with the respective mouse, touch, pointer events.
However as of the current version it is not possible to do the same for the "move" event, that is triggered while the focus point moves.
Upgrading the library to newer versions of Angular is painful because it was created at a time when the Angular CLI was not around.
Switching the current manual build process using tsc
, ngc
and rollup
to the Angular CLI should hopefully lead to easier upgrades.
Hi,
If i'm using mouse events it works fine. In mousedown I get the first control and in mouseup I get the second control.
But if i'm using touch events i'm getting only the first control. In touchstart I get the first control (it's correct) but in touchend I was expecting the second control - but get first control again.
I'm using version 4.1.0 with angular 5.2.2 and the relevant code is:
<ng-template ngFor let-item let-i="index" [ngForOf]="locals.Locals">
<svg:g (down)="activate($event, item)" (up)="deactivate($event, item)" class="container small"
Thanks.
Hi,
Your library is really usefull and interesting to understand how works angular, thanks for it!
I got a question not directly related to ng2-events
but you seems to deeply understand how angular manage template event listeners "under the hood" so, maybe, you can help me (if that's not right place for, just close the issue..).
I got an angular library named angular-split and would like to use your UndetectedEventPlugin only inside my library component template.
I've tried to add the EventPlugin inside component providers
but it's not recognized (no error but handler functions never called):
@Component({
selector: 'as-split',
providers: [{
provide: EVENT_MANAGER_PLUGINS,
useClass: UndetectedEventPlugin,
multi: true
}],
template: `<div (undetected.click)="x()"></div>`,
})
export class SplitComponent {...}
On the contrary, if I add it inside library module providers
, it works too well because all app using my library module have access to (undetected.anyevent)
syntax which I don't want:
@NgModule({
imports: [...], declarations: [...], exports: [...],
providers: [
{
provide: EVENT_MANAGER_PLUGINS,
useClass: UndetectedEventPlugin,
multi: true
}
]
})
export class AngularSplitModule {}
Any clue about it with your knowledge?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.