NgCheatcodes
Toggle features by adding cheat codes to your Angular application.
Installation
To install this library, run:
$ npm install ng-cheatcodes --save
Getting started
Once you have installed ng-cheatcodes, import the module in your Angular application:
;; ; // Import the module;
The Konami code will be available by default (up, up, down, down, left, right, left, right, b, a)
Aditionally, you can configure your own cheat codes:
;; ; // Import the module;
When providing your own cheat codes, you will lose the Konami code. You can import the Konami cheat code to add to your own list of cheat codes:
; ... NgCheatcodesModule.forRoot
Available CheatKeys
// directional keys left, up, right, down // letters (lowercase only) a - z // numbers zero, one, two, three, four, five, six, seven, eight, nine, // other dot, dash, space
Examples
Use the Structural directive in your Angular application just like *ngIf:
<!-- Provide the name of the cheat code that must be triggered and active, for the div to be rendered-->Hello World!
Use the NgCheatcodesService to subscribe to cheat events.
constructorngCheatcodesService: NgCheatcodesService
This library was generated with Angular CLI version 7.2.0.
License
MIT ©