leocaseiro / angular-chosen

AngularJS Chosen directive is an AngularJS Directive that brings the Chosen jQuery in a AngularJS way
http://leocaseiro.github.io/angular-chosen/
MIT License
682 stars 248 forks source link

Targeting the $('.chosen-container') in directive #202

Closed typologist closed 8 years ago

typologist commented 8 years ago

I'm trying to add custom functionality to certain events. So, in my directive's link function I'm trying to do this:

$('.chosen-container').bind('mousedown.chosen', ...

But it doesn't work. How can I access the chosen container element?

PD. I'm already loading jQuery before angular.

leocaseiro commented 8 years ago

Hi @typologist, thank you using the directive and thank you for your issue.

I'm not sure what you're trying to get, but we have few examples at the docs page. Have you checked it out?

Are you using a ng-model?

leocaseiro commented 8 years ago

Hi @typologist, I was wondering if you still having this issue or if you came up with a solution...

typologist commented 8 years ago

Sorry, I forgot to replay sooner. I managed to access the chosen container by wrapping my code in a $timeout. Something I wasn't able to do, though, was accessing all the containers generated programatically. I can post some code tomorrow to explain it a little better. Thanks for the follow up leo!

leocaseiro commented 8 years ago

No worries. I'm glad you worked it out. Thanks for your reply.