Skip to content

Instantly share code, notes, and snippets.

@wrozka
Created October 20, 2014 12:21
Show Gist options
  • Save wrozka/e94edcc836445a5706ac to your computer and use it in GitHub Desktop.
Save wrozka/e94edcc836445a5706ac to your computer and use it in GitHub Desktop.
$provide.decorate('ngClick', function($delegate) {
var compile = $delegate.compile;
$delegate.compile = function($element, attrs) {
attrs.ngClick='__wrapResult__('+attrs.ngClick+')';
var link = compile($element, attrs)
return function($scope, element, attrs) {
$scope.__wrapResult__ = function(expression) {
return function() {
var progress = $parse(attrs.progress).setter;
progress($parse(expression)($scope));
}
};
return link($scope, element, attrs);
}
};
return $delegate;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment