Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

ng:hover directive is a must #559

Closed
sgtpep opened this issue Sep 14, 2011 · 4 comments
Closed

ng:hover directive is a must #559

sgtpep opened this issue Sep 14, 2011 · 4 comments

Comments

@sgtpep
Copy link
Contributor

sgtpep commented Sep 14, 2011

Hopefully it could be easily implemented in few lines of code (CoffeeScript):

angular.directive 'ng:hover', (expression, compiledElement) ->
(linkElement) ->
linkElement.hover (@event) => @$eval(expression)

After that I can use it like this: ng:hover="someAction(event)". It's important to have jQuery event Object in scope to be more crossbrowser.

It could be very nice to see ng:hover in AngularJS core!

@esprehn
Copy link
Contributor

esprehn commented Sep 14, 2011

Exposing the event object directly doesn't make sense, it just bleeds the DOM into your controllers (ex. event.target) and mocking event objects is difficult in tests.

It might make sense to eventually have a magic $event that exposes only data (non node) properties like pageX/pageY, but that should probably happen separate to ng:hover. ex. ng:click="action($event.pageX, $event.pageY)"

@sgtpep
Copy link
Contributor Author

sgtpep commented Sep 14, 2011

I forgot about the testing aspect and agree with your suggestion about separating event object from controller.

@vojtajina
Copy link
Contributor

Closing as duplication of #314

@Ahmed-Badawy
Copy link

ng-hover please.
also need pagination for the ng-repeat, also some more filters to it...
also file upload libs are killing me. they are unreliable, can you provide some directive for it.
and please some additional functions to select & manipulate the DOM.
give us a choice, i Love data binding & directives but sometimes i want to do it the bad way.
so instead of coping functions from jquery to use them in my projects, how a bout providing us with a module with some functions for DOM manipulations.

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

No branches or pull requests

4 participants