diff --git a/Demo b/Demo index a979c02..b944e8d 160000 --- a/Demo +++ b/Demo @@ -1 +1 @@ -Subproject commit a979c0284577993c3f3b1c6acccbb7d6e6994003 +Subproject commit b944e8d3ad61fd295a08eb52c5b79e133b468e31 diff --git a/README.md b/README.md index 9bccee7..5db812f 100644 --- a/README.md +++ b/README.md @@ -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) *** @@ -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) { @@ -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:** > diff --git a/package-lock.json b/package-lock.json index 8aef811..642244a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "angular-material-dynamic-themes", - "version": "1.0.3", + "version": "1.0.4", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 542479f..f7a63cd 100644 --- a/package.json +++ b/package.json @@ -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",