Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ng-change doesn't get the $event argument #6370

edriang opened this issue Feb 20, 2014 · 3 comments


Copy link

@edriang edriang commented Feb 20, 2014

When you attach a listener to a radio button with ng-change yout can't pass an $event argument.

If I change ng-change to ng-click it does the trick, but it will be better if $event is available for the different event-listeners defined by angular directives


This comment has been minimized.

Copy link

@caitp caitp commented Feb 20, 2014

ng-change is not a directive for handling the change event (I realize that this is confusing given the name), but is actually instead notified when ngModelController.$setViewValue() is called and the value changes (because ng-change adds a listener to the $viewChangeListeners collection). So this is as expected.


This comment has been minimized.

Copy link

@NickChristensen NickChristensen commented Jan 20, 2015

So sorry to resurrect this @caitp , but could you point me in the right direction if I wanted to handle (and possibly preventDefault) a change event? Specifically thinking about a <select>


This comment has been minimized.

Copy link

@caitp caitp commented Jan 20, 2015

use jQuery#on() or jqLite#on() to bind event listeners, and call preventDefault() if you need to

asfgit pushed a commit to apache/zeppelin that referenced this issue May 4, 2017
### What is this PR for?
`ng-change` can not capture event, so that means `$event.timeStamp` is undefined. angular/angular.js#6370
This cause AngularElem's onChange is only invoked once. This PR use another approach to update the angularObject.

### What type of PR is it?
[Bug Fix]

### Todos
* [ ] - Task

### What is the Jira issue?

### How should this be tested?
Tested manually

### Screenshots (if appropriate)

### Questions:
* Does the licenses files need update? No
* Is there breaking changes for older versions? No
* Does this needs documentation? No

Author: Jeff Zhang <>

Closes #2312 from zjffdu/ZEPPELIN-2486 and squashes the following commits:

4039d6b [Jeff Zhang] ZEPPELIN-2486. AngularElem's onChange is only invoked once
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
3 participants
You can’t perform that action at this time.