@christophhu/ngx-debug-mode
v19.2.1
Published
Angular debug mode toggle library for toggling with local storage support.
Maintainers
Readme
Ngx-Debug-Mode
Frameworks and Languages
Demo
Description
This Repository contains a simple Angular library for toggling the debug mode. It is designed to be easy to use and integrate into any Angular application.
It uses the localStorage-API to save the user's preference for debug mode, so that the setting persists across page reloads.
Installation
npm i @christophhu/ngx-debug-modeUse
With default toggle
<debug-mode></debug-mode>With custom toggle
<debug-mode>
<input type="checkbox" class="toggle" id="toggle" (change)="toggleDebug()"/>
</debug-mode>import { DebugModeService, DebugModeComponent } from "@christophhu/ngx-debug-mode";
@Component({
...
imports: [
DebugModeComponent
],
providers: [
DebugModeService
]
})
export class TestComponent {
constructor(private _debugModeService: DebugModeService) {}
toggleDebug() {
this._debugModeService.toggleDebug()
}
getDebug(): Observable<boolean> {
return this._debugModeService.debug$
}
}