Skip to content

The ngx-debug-mode repostory is a demo application of the ngx-debug-mode library. The library adds a simple toggle-component. So you can switch to hide or show all elements in your application.

License

Notifications You must be signed in to change notification settings

ChristophHu/ngx-debug-mode

Repository files navigation

Ngx-Debug-Mode

Frameworks and Languages

Static Badge
Static Badge
Static Badge

Demo

image

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. The library is easy to use and can be installed via npm.

Installation

npm i @christophhu/ngx-debug-mode

Use

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$
  }
}

About

The ngx-debug-mode repostory is a demo application of the ngx-debug-mode library. The library adds a simple toggle-component. So you can switch to hide or show all elements in your application.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published