Skip to content

Commit

Permalink
fix(directive): normalize names in prop and event bindings (#4)
Browse files Browse the repository at this point in the history
It seems when jQuery is used, it will usually wrap the original CustomEvent which breaks the
interface of the expected detail payload
  • Loading branch information
JamesHenry authored Nov 9, 2018
1 parent 52d7c19 commit 5dc66fb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ export const directiveFactory = [
// Set up event bindings.
eventExprPairs.forEach(([eventName, parsedExpr]) => {
elem.on(eventName, evt => {
var callback = parsedExpr.bind(null, scope, { $event: evt });
evt = evt.originalEvent || evt;
const callback = parsedExpr.bind(null, scope, { $event: evt });

if (!$rootScope.$$phase) {
scope.$apply(callback);
Expand Down

0 comments on commit 5dc66fb

Please sign in to comment.