Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Implemented a "safe apply" pattern to the event directives. #5402

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/ng/directive/ngEventDirs.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,13 @@ forEach(
var fn = $parse(attr[directiveName]);
return function(scope, element, attr) {
element.on(lowercase(name), function(event) {
scope.$apply(function() {
if(!scope.$$phase) {
scope.$apply(function() {
fn(scope, {$event:event});
});
} else {
fn(scope, {$event:event});
});
}
});
};
}
Expand Down