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

event on-select and $item #20

Closed
Isaac6702 opened this issue Feb 15, 2016 · 2 comments
Closed

event on-select and $item #20

Isaac6702 opened this issue Feb 15, 2016 · 2 comments

Comments

@Isaac6702
Copy link

Hi,
As I can trigger an event when something of a "Standard Select" is selected and know the item that was selected.

Is there any on-select = "function ($ item)" event

@adityasharat
Copy link
Owner

Add a watch to the ng-model in your controller

<select chosen ng-model="data.selected">
$scope.$watch('data.selected', function () {
  // handle the change
});

or use ng-change

<select chosen ng-model="data.selected" ng-change="myMethod(data.selected)">

@Isaac6702
Copy link
Author

Perfect, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants