Super Sale Limited Time 50% OFF for All-Access Plans
Save 50% Now

Angular - Demo 1 - Persist sidebar status


Hi!

I am using Metronic Demo 1 for Angular and I trying to save the sidebar status (either minimized or not) so it stays the same way after a refresh

In sidebar.component.ts

Tried to set 'data-kt-app-sidebar-minimize' to either 'on' or null but when I do, I can't change the status again.
Also tried to set
this.toggleEnabled = true
this.toggleButtonClass = 'active'

But it doesn't work either.

Thanks!


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (3)


Great to hear that it worked for you! If you have any further questions or issues, feel free to reach out and we'll do our best to assist you.

Thanks for using our product, and have a great day!

Best regards,



Hi Hernan,

In the file demo1/src/app/_metronic/layout/core/configs/dark-sidebar.config.ts, could you please try to update this config value to true?

The config path is app.sidebar.default.minimize.desktop.default

Thanks



Worked like a charm. I just changed this config to whatever value I have saved in the init of sidebar.component.ts

Thanks!


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(