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

Layout service should be revisited in the angular demo1 project


Not sure how did this happen but:


getProp(path: string, config?: ILayout): string | boolean | undefined | Object {
if (config) {
return objectPath.get(config, path);
}

return objectPath.get(this.layoutConfigSubject.value, path);
}


This makes the code unsafe. Usages like this:

this.appSidebarDefaultMinimizeMobileEnabled = this.layout.getProp(
"app.sidebar.default.minimize.mobile.enabled",
config
) as boolean;

Should be formalized to:

this.appSidebarDefaultMinimizeMobileEnabled = config.app.sidebar.default.minimize.mobile.enabled;


Which is typesafe and would immediatley indicate that properties are missing from the LayoutConfiguration.


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 (1)


Hi Bálint Nagy

Sorry for the delay in response.

Thank you for your suggestion. It's a great idea to enhance the safety of our variables based on the interface. We will consider implementing this in our future updates.


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  :(