# Add Ishara to Angular

Add the feedback widget to an Angular app by pasting one script tag before the closing body tag of src/index.html, not in a component.

- Where it goes: `src/index.html`, before `</body>`
- Allowed domains: your own domain
- Time: about 2 minutes

## Steps

1. In Ishara, open **Sites → your site → Install** and copy the line under **Add the line to your site**. Your site’s key is already in it:

```html
<script src="https://useishara.com/w.js" data-site="pk_…" defer></script>
```

2. Open `src/index.html` (in a multi-project workspace, `projects/your-app/src/index.html`) and paste the line just before `</body>`. The build keeps your content and adds Angular’s own bundles to it:

```html
<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>MyApp</title>
  <base href="/">
  <meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
  <app-root></app-root>
  <script src="https://useishara.com/w.js" data-site="pk_…" defer></script>
</body>
</html>
```

3. Build and deploy the app.
4. Open your site. Back on the **Install** page, **Check it’s live** turns into **The widget is live** as soon as the widget loads. Then open the **Reviewer link** from the same page: only people who open it see **Leave a note**.

## Good to know

- Don’t add the tag in a component template or through an `[innerHTML]` binding: Angular’s sanitiser removes `<script>` elements there. `src/index.html` is outside its reach.
- The `scripts` option in `angular.json` bundles local files; it isn’t meant for a script from another site with its own attributes.
- Angular’s recommended strict Content Security Policy (`script-src 'self' 'nonce-…'`) blocks the widget unless you add its origin to `script-src` ([details](https://useishara.com/docs#csp)).

Checked against the official docs on 2026-11-12: [Angular: file structure](https://angular.dev/reference/configs/file-structure), [Angular: security](https://angular.dev/best-practices/security), [Angular: workspace configuration](https://angular.dev/reference/configs/workspace-config).
