Skip to content

Commit

Permalink
fix(docs): 1. toggleDarkness() was added to the documentation
Browse files Browse the repository at this point in the history
1. `toggleDarkness()` was added to the documentation
2. `setTheme()` was renamed to `setActiveTheme()` and Demo was updated
  • Loading branch information
mirismaili committed Aug 3, 2019
1 parent a7610b0 commit 795e873
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Demo
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

Making able the app to switch between material themes at run-time

[![Video](https://raw.githubusercontent.com/mirismaili/AngularMaterialDynamicThemes/master/res/preview0.gif "Video")](https://github.com/mirismaili/AngularMaterialDynamicThemes)
[![Video](https://raw.githubusercontent.com/mirismaili/AngularMaterialDynamicThemes/a979c0284577993c3f3b1c6acccbb7d6e6994003/res/preview0.gif "Video")](https://github.com/mirismaili/AngularMaterialDynamicThemes)

***

Expand Down Expand Up @@ -104,10 +104,10 @@ export class AppComponent {

constructor(private overlayContainer: OverlayContainer) {
// Set default theme here:
this.setTheme('deeppurple-amber', /* darkness: */ false)
this.setActiveTheme('deeppurple-amber', /* darkness: */ false)
}

setTheme(theme: string, darkness: boolean = null) {
setActiveTheme(theme: string, darkness: boolean = null) {
if (darkness === null)
darkness = this.isThemeDark
else if (this.isThemeDark === darkness) {
Expand All @@ -127,10 +127,14 @@ export class AppComponent {

this.activeThemeCssClass = cssClass
}

toggleDarkness() {
this.setActiveTheme(this.activeTheme, !this.isThemeDark)
}
}
```

And change the theme using `setTheme()` whenever you want. ✓
And change the theme using `setActiveTheme()` (or `toggleDarkness()`) whenever you want. ✓

> **A more detailed instruction can be found here:**
>
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-material-dynamic-themes",
"version": "1.0.3",
"version": "1.0.4",
"description": "Making able the app to switch between material themes at run-time",
"scripts": {
"README.md-TOC": "node markdown-toc.js -f README.md",
Expand Down

0 comments on commit 795e873

Please sign in to comment.