How do I show noscript content in my Angular app?

53 views Asked by At

I want to display html content for users who don't use javascript in my Angular app, how can I do it?

Using the noscript tag in the index.html file doesn't work

<body>
    <noscript>Test</noscript>
    <app-root></app-root>
</body>
1

There are 1 answers

0
Naren Murali On

I just checked in my local system, the noscript tag works great, please try restarting the server once, it will start working.

To disable Javascript

next to refresh button on browser press the button next to url, then click on site settings and new tab will open, there disable javascript!

index.html

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>Test</title>
  <base href="/">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="icon" type="image/x-icon" href="favicon.ico">
</head>
<body>
  <app-root></app-root>
  <noscript>Please enable javascript!</noscript>
</body>
</html>