ng-golden-layout
Angular 2.4.x Compatible
Installation
To install this library and golden-layout peerDependency, run:
$ npm install @goldsam/ng-golden-layout golden-layout --save$ npm install @types/jquery --save-dev
Examples
First, import the GoldenLayoutModule into your root AppModule
;
Then, add GoldenLayoutModule.forRoot() to your AppModule's import array
If you have any sub/feature modules that also use hotkeys, import the GoldenLayoutModule (but NOT .forRoot())
Then inject the service into your constructor and add a new hotkey
constructorprivate _hotkeysService: HotkeysService
It also handles passing an array of hotkey combinations for a single callback
this._hotkeysService.addnew Hotkey,;
Your callback must return either a boolean or an "ExtendedKeyboardEvent".
For more information on what hotkeys can be used, check out https://craig.is/killing/mice
This library is a work in progress and any issues/pull-requests are welcomed! Based off of the angular-hotkeys library
Golden Layout Root
To enable the cheat sheet, simply add <hotkeys-cheatsheet></hotkeys-cheatsheet>
to your top level component template.
The HotkeysService
will automatically register the ?
key combo to toggle the cheat sheet.
Cheat Sheet Customization
- You can now pass in custom options in
HotkeysModule.forRoot(options: IHotkeyOptions)
.
;
- You can also customize the title of the cheat sheet component.
<!-- Default: 'Keyboard Shortcuts:' -->
TODO
- Create unit and E2E tests
Development
To generate all * }.js
, *.js.map
and *.d.ts
files:
$ npm run tsc
License
MIT © Sam Goldmann