Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Angular integration #85

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,45 @@ var nightwind = {

</details>

<details>
<summary>Angular (using the <a href="https://github.com/devLukaszMichalak/ngx-nightwind">ngx-nightwind</a> library)</summary>

NgxNightwind is a library that provides a service with helper functions to easily manage nightwind dark mode in Angular applications.

First, provide the NgxNightwindService using the `provideNgxNightwind()` method in your application configuration:
```ts
import { provideNgxNightwind } from 'ngx-nightwind';

export const appConfig: ApplicationConfig = {
providers: [
...
provideNgxNightwind(),
...
]
};
```

After providing the service, you can use it to manipulate the mode in your components:

```ts
import { NgxNightwind } from 'ngx-nightwind';


constructor(private ngxNightwind: NgxNightwind) {

// Switches to light mode
this.ngxNightwind.enableLight();

// Switches to dark mode
this.ngxNightwind.enableDark();

// Toggles the mode
this.ngxNightwind.toggle();

}
```
</details>


## Getting started

Expand Down