How to add a LinkedIn feed to an Angular app
Angular doesn't support <script> elements in component templates, so load embed.js once in index.html, put the widget <div> in your template and call window.LinkedEmbed?.mount() after the view renders.
Step-by-step: add a LinkedIn widget to Angular
- 1
Create your LinkedIn widget
Sign up for free, click New widget, choose Person or Company, and paste your LinkedIn profile or company page URL.
- 2
Customize and copy the embed code
Pick a widget (posts feed, profile card, company page, jobs, recommendations, certifications or projects), match your brand, then open the Integration tab and copy the code.
- 3
Load the script once
Add the embed <script> tag to src/index.html, just before </body>. It loads once for the whole app.
- 4
Add the placeholder to a template
Paste the widget <div> (with its class and data-widget-id) into the component template where the widget should appear.
- 5
Mount after the view renders
In the component's ngAfterViewInit hook, call (window as any).LinkedEmbed?.mount(). That renders the widget each time the component is created, for example when the router loads its route.
Your embed code looks like this
Copy the exact code, with your widget ID, from the Integration tab in the LinkedInEmbed dashboard.
<div class="linkedembed-widget" data-widget-id="YOUR_WIDGET_ID"></div>
<script src="https://www.linkedinembed.com/embed.js" async></script>Tips for Angular
- Don't inject the embed code with [innerHTML]. Angular sanitizes it and removes the <script> element.
- Using server-side rendering? Only call mount() in the browser, since the script works with the page's DOM.
- The widget renders in its own iframe, so your global styles and view encapsulation don't affect it.
- Prefer no JavaScript? Put the iframe snippet straight into the template. The same pattern for React is in the React & Next.js guide.
Widget not showing or not updating? Read the troubleshooting guide.
Ready to add LinkedIn to Angular?
Create your widget for free and get your embed code.
Sources
Angular steps checked against its documentation on October 31, 2026.
LinkedIn on Angular: FAQ
Why doesn't the embed code work when pasted into an Angular template?
Angular doesn't support <script> elements in templates, so the script never runs. Load embed.js from index.html and keep only the <div> in the template.
Is there an Angular package?
No package is needed. The embed script is a tiny standalone file, and window.LinkedEmbed?.mount() renders any new placeholders.
Which LinkedIn widget will you add to Angular?
Every widget uses the same embed code, so the steps above work for all of them.
Put your LinkedIn on your website today
Create your first widget in about two minutes. Free plan, no credit card required.