Skip to content

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

Description

@msbasanth

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions