diff --git a/.gitignore b/.gitignore index 46a0080..2b97644 100644 --- a/.gitignore +++ b/.gitignore @@ -41,6 +41,7 @@ npm-debug.log yarn-error.log testem.log /typings +.angular # System Files .DS_Store diff --git a/package.json b/package.json index 3048c48..4c4b6f2 100644 --- a/package.json +++ b/package.json @@ -31,9 +31,6 @@ "bugs": { "url": "git@github.com:brtnshrdr/angular2-hotkeys.git/issues" }, - "peerDependencies": { - "rxjs": "^5.5.0 || ^6.0.0" - }, "dependencies": { "@types/mousetrap": "^1.6.9", "mousetrap": "^1.6.5", diff --git a/src/lib/hotkeys.directive.ts b/src/lib/hotkeys.directive.ts index 40701b1..abd4571 100644 --- a/src/lib/hotkeys.directive.ts +++ b/src/lib/hotkeys.directive.ts @@ -16,7 +16,8 @@ export class HotkeysDirective implements OnInit, OnDestroy { private oldHotkeys: Hotkey[] = []; constructor(private hotkeysService: HotkeysService, private elementRef: ElementRef) { - this.mousetrap = new Mousetrap(this.elementRef.nativeElement); // Bind hotkeys to the current element (and any children) + // Bind hotkeys to the current element (and any children) + this.mousetrap = new (Mousetrap as any).default(this.elementRef.nativeElement); } ngOnInit() { diff --git a/src/lib/hotkeys.service.ts b/src/lib/hotkeys.service.ts index bc030aa..5942f1e 100644 --- a/src/lib/hotkeys.service.ts +++ b/src/lib/hotkeys.service.ts @@ -3,7 +3,7 @@ import { Hotkey } from './hotkey.model'; import { Subject } from 'rxjs'; import { HotkeyOptions, IHotkeyOptions } from './hotkey.options'; import { MousetrapInstance } from 'mousetrap'; -import * as Mousetrap from "mousetrap"; +import * as Mousetrap from 'mousetrap'; @Injectable({ providedIn: 'root' @@ -25,7 +25,7 @@ export class HotkeysService { } return (element.contentEditable && element.contentEditable === 'true'); }; - this.mousetrap = new (Mousetrap as any)(); + this.mousetrap = new (Mousetrap as any).default(); this.initCheatSheet(); }