0

I am trying to link the side menu item to an external website, but it doesn't seem to work

Below is my code

{
  title: 'Word of the Week',
  url: '/word',
  icon: './assets/sample-icons/side-menu/word.svg'
},
{
  title: 'Facebook',
  url: 'https://www.fb.com',
  icon: './assets/sample-icons/side-menu/fb.svg'
},

I tried removing https, starting with www and other modifications but they don't seem to make it work

Any help would be appreciated

Vignesh Subramanian
  • 7,161
  • 14
  • 87
  • 150

1 Answers1

0

This happens because Angular escapes the URL for security reasons (see https://angular.io/api/platform-browser/DomSanitizer ).

Here is a good solution, that uses a redirect guard: https://stackoverflow.com/a/51059505/3530591

below43
  • 509
  • 6
  • 8