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

Selector issues while integrating MSAL [Angular 15]


In the app.component.ts, the '@Component' decorator uses the selector "body[root].

I have followed the Microsoft Documentation to include MSAL in our project (default auth has been removed from the project while following the skeleton guide)

For MSAL to work, the app component needs the selector to refer to a html tag 'app-root' with the HTML as <app-root></app-root> and for another tag <app-redirect> to be added.

When the app.component.ts uses selector body[root] - the pages load normal however in the console the MSAL errors with:
'ERROR Error: The selector "app-redirect" did not match any elements'

If I change the app.component.ts selector to 'app-root' the console shows MSAL Auth working properly however the application will never load past the splash screen I imagine because Metronic is dependent on the 'root' tag being used through the body element.

Is there a way to change metronic to work properly with the 'app-root' method? I am relatively new to Angular so perhaps there is a better solution.

Any help is appreciated!


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


is there any update ? I am having the same issue. Please guide how to resolve ?



Hi Devon,

I apologize for the delay in getting back to you. Regarding your previous question, it seems that the body[root] is required for the style and removing it could potentially break the CSS. We will need to investigate this further to provide you with a more accurate solution.

Thank you for your patience.

Best regards.



Hi Faizal, any news on this as this is a large issue for our system?



I have the same issue!



*To clarify, I do have the app-redirect tag in my index.html but it is not found when body[root] is being used.


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