Skip to content

Commit

Permalink
Merge pull request #116 from wittlock/angular_8_fix
Browse files Browse the repository at this point in the history
Angular 8 fix
  • Loading branch information
wittlock authored Sep 3, 2019
2 parents 7a3baca + ef6edc8 commit 5f7f2e4
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 60 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Angular
/compiled
*.metadata.json
*.ngsummary.json
package-lock.json

# Node
node_modules/*
Expand Down
2 changes: 1 addition & 1 deletion README.MD
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# angular2-hotkeys
Angular 5.2.0+, 6, 7 and 8 Compatible. Older versions might work but isn't officially tested. Also library is Angular IVY ready.
Angular 5, 6, 7 and 8 Compatible. Older versions might work but isn't officially tested.
## Installation

To install this library, run:
Expand Down
30 changes: 29 additions & 1 deletion index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,29 @@
export * from './public_api';
import {NgModule, ModuleWithProviders} from '@angular/core';
import {CommonModule} from '@angular/common';
import {HotkeysDirective} from './src/hotkeys.directive';
import {CheatSheetComponent} from './src/cheatsheet.component';
import {IHotkeyOptions, HotkeyOptions} from './src/hotkey.options';
import {HotkeysService} from './src/hotkeys.service';

export * from './src/cheatsheet.component';
export * from './src/hotkey.model';
export * from './src/hotkey.options';
export * from './src/hotkeys.directive';
export * from './src/hotkeys.service';

@NgModule({
imports : [CommonModule],
exports : [HotkeysDirective, CheatSheetComponent],
declarations : [HotkeysDirective, CheatSheetComponent]
})
export class HotkeyModule {
static forRoot(options: IHotkeyOptions = {}): ModuleWithProviders {
return {
ngModule : HotkeyModule,
providers : [
HotkeysService,
{provide : HotkeyOptions, useValue : options}
]
};
}
}
24 changes: 11 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "angular2-hotkeys",
"version": "2.1.4",
"version": "2.1.5",
"scripts": {
"lint": "tslint src/**/*.ts",
"test": "tsc && karma start",
"prepare": "tsc && ngc",
"tsc": "tsc",
"tsc:watch": "tsc --watch",
"ngc": "ngc -p tsconfig.json"
"ngc": "./node_modules/.bin/ngc -p tsconfig.json"
},
"repository": {
"type": "git",
Expand All @@ -28,23 +28,21 @@
"bugs": {
"url": "[email protected]:brtnshrdr/angular2-hotkeys.git/issues"
},
"module": "./angular2-hotkeys.js",
"typings":"./angular2-hotkeys.d.ts",
"main": "./index.js",
"dependencies": {
"mousetrap": "^1.6.0",
"@types/mousetrap": "^1.6.0"
},
"devDependencies": {
"@angular/common": "8.0.0",
"@angular/compiler": "8.0.0",
"@angular/compiler-cli": "8.0.0",
"@angular/core": "8.0.0",
"tsickle": "0.35.0",
"@angular/common": "8.2.4",
"@angular/compiler": "8.2.4",
"@angular/compiler-cli": "8.2.4",
"@angular/core": "8.2.4",
"@types/core-js": "0.9.41",
"codelyzer": "~3.0.1",
"rxjs": "^6.5.0",
"tslint": "^3.15.1",
"typescript": "~3.4.5",
"codelyzer": "^5.0.0",
"rxjs": "^6.5.2",
"tslint": "^5.0.0",
"typescript": "~3.5.3",
"zone.js": "^0.9.1"
},
"peerDependencies": {
Expand Down
6 changes: 0 additions & 6 deletions public_api.ts

This file was deleted.

12 changes: 6 additions & 6 deletions src/hotkey.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ export class Hotkey {
/**
* Creates a new Hotkey for Mousetrap binding
*
* @param combo mousetrap key binding
* @param description description for the help menu
* @param callback method to call when key is pressed
* @param action the type of event to listen for (for mousetrap)
* @param allowIn an array of tag names to allow this combo in ('INPUT', 'SELECT', and/or 'TEXTAREA')
* @param persistent if true, the binding is preserved upon route changes
* @param {string} combo mousetrap key binding
* @param {string} description description for the help menu
* @param {Function} callback method to call when key is pressed
* @param {string} action the type of event to listen for (for mousetrap)
* @param {array} allowIn an array of tag names to allow this combo in ('INPUT', 'SELECT', and/or 'TEXTAREA')
* @param {boolean} persistent if true, the binding is preserved upon route changes
*/
constructor(public combo: string | string[], public callback: (event: KeyboardEvent, combo: string) => ExtendedKeyboardEvent | boolean,
public allowIn?: string[], public description?: string | Function, public action?: string,
Expand Down
23 changes: 0 additions & 23 deletions src/hotkey.module.ts

This file was deleted.

14 changes: 4 additions & 10 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
{
"compilerOptions": {
"noImplicitAny": true,
"module": "esnext",
"target": "es5",
"moduleResolution": "node",
"module": "commonjs",
"target": "ES5",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"sourceMap": true,
Expand All @@ -14,18 +13,13 @@
]
},
"angularCompilerOptions": {
"enableResourceInlining": true,
"annotateForClosureCompiler": true,
"strictMetadataEmit": false,
"skipTemplateCodegen": true,
"flatModuleOutFile": "angular2-hotkeys.js",
"flatModuleId": "angular2-hotkeys"
"genDir": "compiled"
},
"typeRoots": [
"node_modules/@types"
],
"files": [
"public_api.ts"
"index.ts"
],
"exclude": [
"node_modules"
Expand Down

0 comments on commit 5f7f2e4

Please sign in to comment.