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

leapjs-plugins in Angular 2/4/6 application #36

Open
msbasanth opened this issue Nov 6, 2018 · 0 comments
Open

leapjs-plugins in Angular 2/4/6 application #36

msbasanth opened this issue Nov 6, 2018 · 0 comments

Comments

@msbasanth
Copy link

Dear All,

I tried adding leapjs-plugins in
Added two scripts in index.html
`

<script src="https://js.leapmotion.com/leap-0.6.4.js"></script> <script src="https://js.leapmotion.com/leap-plugins-0.1.12.js"></script>`

With by just adding declare var Leap; in one of the class I could use Leap.

        const controller = new Leap.Controller();
        controller.connect();
        controller.on('keyTap', function (circle, frame) {
            console.log('Key Tap Gesture');
        });
        controller.on('screenTap', function (circle, frame) {
            console.log('Screen Tap Gesture');
        });
        controller.on('swipe', function (circle, frame) {
            console.log('Swipe Gesture');
        });

But when I use leapjs-plugins as mentioned in the documentation,

        controller.use('handEntry');
        controller.on('handFound',
            function (hand) { console.log('hand found', hand); }
        );

I am getting error,

ng:///AppModule/AppComponent_Host.ngfactory.js:5 ERROR Error: Leap Plugin handEntry not found.
    at viewWrappedDebugError (vendor.js:60071)
    at callWithDebugContext (vendor.js:63837)
    at Object.debugCheckAndUpdateView [as checkAndUpdateView] (vendor.js:63505)
    at ViewRef_.push../node_modules/@angular/core/fesm5/core.js.ViewRef_.detectChanges (vendor.js:61321)
    at vendor.js:57198
    at Array.forEach (<anonymous>)
    at ApplicationRef.push../node_modules/@angular/core/fesm5/core.js.ApplicationRef.tick (vendor.js:57198)
    at ApplicationRef.push../node_modules/@angular/core/fesm5/core.js.ApplicationRef._loadComponent (vendor.js:57232)
    at ApplicationRef.push../node_modules/@angular/core/fesm5/core.js.ApplicationRef.bootstrap (vendor.js:57174)
    at vendor.js:56975

Any hint on how we can use leapjs-plugins in Angular.

Thanks
Basanth

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

No branches or pull requests

1 participant