Just a heads up, If you're trying to listen to custom events like the ones
generated by bootstrap components, Luke's solution works see (a)
<code>angular.module('myApp',[]).directive('myDirective',['$document',
function($document){
return {
link: function(scope, element){
$(element).bind('some.custom.event',function(event){
// do something
});
}
};
}]);</code>
On Tuesday, February 25, 2014 at 2:36:25 AM UTC-5, Sander Elias wrote:
>
> Hi Luke,
>
> You don’t need jquery at all for this. And in a directive you have the
> element available, in a pre wrapped state.
> like this:
>
> angular.module('myApp', []).directive('catchTransitions', function(){
> return{
> link: function(scope,element){
> element.on('transitionend', function(e){ //be aware of other event
> names from other browsers vendor-prefixed
> console.log(''got a css transition event", e)
> })
> }
> })
>
> I prefer to use jquery as least as possible. Nowadays I seldom include it
> in my projects.
>
> Regards
> Sander
>
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.