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

Angular 2 RC 2 Hammer Gestures #9461

Closed
naveedahmed1 opened this issue Jun 22, 2016 · 9 comments
Closed

Angular 2 RC 2 Hammer Gestures #9461

naveedahmed1 opened this issue Jun 22, 2016 · 9 comments
Assignees
Labels
feature Issue that requests a new feature help wanted An issue that is suitable for a community contributor (based on its complexity/scope).

Comments

@naveedahmed1
Copy link
Contributor

naveedahmed1 commented Jun 22, 2016

Its not clear if the Hammer gestures are supported in Angular 2 RC 2 or not.

From the API we can see

HAMMER_GESTURE_CONFIG 
HammerGestureConfig

under

@angular/platform-browser
( https://angular.io/docs/ts/latest/api/#!?apiFilter=hammer )

But its not clear how to use it, some posts on internet suggest including hammer.js but if its a part of API I believe one would expect to use it without any external dependency.

@vicb
Copy link
Contributor

vicb commented Jun 22, 2016

It is supported, please check playground/src/gestures.

We should document it better /cc @wardbell

@vicb vicb added the feature Issue that requests a new feature label Jun 22, 2016
@naveedahmed1
Copy link
Contributor Author

naveedahmed1 commented Jun 22, 2016

Thank you so much @vicb for your reply. I just checked that, and the below file from playground/src/gestures suggests that we will have to include include Hammmer.js as its also including custom build of hammer.

https://github.com/angular/angular/blob/master/modules/playground/src/gestures/index.html

Please correct me if I am wrong.

@vicb
Copy link
Contributor

vicb commented Jun 22, 2016

That was the case when the example was creating probably 1y+ ago because some fix commits were not released. I think they have been released since then.

May be you can try to install the latest hammer.js and update the example. If this works, please submit a PR. Thanks.

@vicb vicb added the help wanted An issue that is suitable for a community contributor (based on its complexity/scope). label Jun 22, 2016
@naveedahmed1
Copy link
Contributor Author

Yes, I tried that before opening the issue and if I include below script everything works.

<script src="http://hammerjs.github.io/dist/hammer.min.js"></script>

Actually I thought that since its part of angular framework may be it could work without including hammmerjs

@vicb
Copy link
Contributor

vicb commented Jun 22, 2016

If you want to update the example in a PR, please add hammerjs as a dev dependency in the package.json and use it from there. Thanks.

@naveedahmed1
Copy link
Contributor Author

naveedahmed1 commented Jun 22, 2016

I have added hammerjs to package.json. Can you please confirm the path which it should map too in live repository:

On my device the following works:

<script src="/node_modules/hammerjs/hammer.min.js"></script>

@vicb
Copy link
Contributor

vicb commented Jun 22, 2016

Check /build.sh to create a link from node_modules in the playground/vendor folder

You can then load the script from /all/playground/vendor/hammer.js

You can test by running build.sh and then got to /dist and run http-server (might need npm i -g http-serverifyou don't have this installed)

@wardbell
Copy link
Contributor

Close as too old.

@wardbell wardbell removed this from TODO in docs Jun 24, 2017
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature Issue that requests a new feature help wanted An issue that is suitable for a community contributor (based on its complexity/scope).
Projects
None yet
Development

No branches or pull requests

3 participants