When can we expect standard mouse events as directives


#1

Can anyone from the core team let me know that when will the standard mouse events implemented as directives will come as out of the box support for ionic?


#2

Check out Angular’s docs…

https://docs.angularjs.org/api/ng/directive/ngMousedown
https://docs.angularjs.org/api/ng/directive/ngMouseenter
https://docs.angularjs.org/api/ng/directive/ngMouseleave
https://docs.angularjs.org/api/ng/directive/ngMousemove
https://docs.angularjs.org/api/ng/directive/ngMouseup

Though not sure why you would need standard mouse events, since this targeted towards mobile…


#3

If i sound naive about how these built in angular events work, then please try running something like

ng-Mousedown="someFunction()"

in Android 4.4 and above. Just see how it behaves.


#4

@mhartington The way you suggested works only on browsers but not on real devices. So I came across this method to access large mouse events that works beautifully both on browsers and real devices.

See this new post that I have posted just now.


#5

hmm, well I’ll be, they don’t work…interesting.

So the events types that you listed in your post are more touch related events, not mouse events, so sorry for the confusion.

As for including hammer.js, you don’t need to. Hammer.js has been ported to ionic and is baked in.

http://ionicframework.com/docs/api/utility/ionic.EventController/

You can use this template to create your own directives based on our touch events.


#6

Yeah I knew that hammer.js is baked into Ionic. You taught me that in one of your posts. But when I did not include hammer.js I got “Hammer is undefined” error. So I explicitly included hammer.js and it worked fine.

Saw your codepen. The way I have listed looks more easy. I will stick to what I have done.

And in the meanwhile can you let me know about this: Tutorial to learn about Hardware Back Button


#7

I’d just be worried about any conflicts in what code is being called where. Just keep an eye out for issues and warnings in your console.


#8

Yes sir! I have not received any warnings or errors in console. Hope everything will be fine.


#9

Figured you would love to see this :smile:

http://ionicframework.com/docs/api/directive/onSwipeUp/


#10

Yeah I read this on the forum. But it does not work at all.


#11

Works for me.

Are you still including hammer.js?


#12

No I removed hammer.js. I also removed gestures.js


#13

@mhartington And you have posted the wrong pen


#14

gestures.js? Are you doing your own custom build of ionic?


#15

No I had explicitly included gestures and listed that as one of the source files explicitly.

<script src="js/ionic/ionic.bundle.js"></script>
	<script src="js/ionic/ionic-swipe-cards.js"></script>
    <!-- Needed for Cordova/PhoneGap (will be a 404 during development) -->
    <script src="cordova.js"></script>
    <script src="js/hammer.js"></script>
    <script src="js/gestures.js"></script>
    <script type="text/javascript" src="js/app.js"></script>
    <script type="text/javascript" src="js/services/service.js"></script>
    <script type="text/javascript" src="js/controllers/controllers.js"></script>

#16

No the pens correct, I just threw the on-hold code into an only example I have.

Alright, are you testing this in the browser or device? So it’s the default code, and no hammer.js or gestures.js…hmmm can you see if there are errors in the console?


#17

This is what I have done.

But when I was trying the new event features I removed hammer and gestures


#18

I am testing it in the browser. Yes it is the default code and no hammer.js and gestures.js. No I did not notice any errors in the console. on-touch, on-tap did not fire at all.


#19

come to chat. This is really slow


#20

IRC? On it right now