How to Create an Online Course and Community with Angular

Publish an Embedin course alongside your Angular app, enable its community, and check learner access before launch.

How to Create an Online Course and Community with Angular

You can use Angular for your website or customer portal and Embedin for lessons and learner discussions. This guide adds a dedicated course page on the same website, with a link to it from your Angular app.

The course page is a separate HTML document rather than an Angular route. Opening it with a normal link gives the embed a fresh page load, including when a learner returns to the course.

1. Prepare your course

In Embedin, create a course, add modules and lessons, and publish the content you want learners to see. For a self-paced course, copy the embed script from course settings. For a cohort course, publish the cohort and copy its cohort-specific script from the Cohorts page. Website embeds are unavailable while Notion-only embedding is enabled.

Under Allowed website domains, add the hostname where the course page will run, such as localhost for local testing and academy.example.com for production. Add any separate preview hostname you use as well.

2. Add a course page

Create public/academy.html in an Angular project configured to serve the public directory as static assets:

<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Academy</title>
  </head>
  <body>
    <h1>Academy</h1>
    <script type="module" data-courseid="YOUR_COURSE_ID" src="https://embed.embedin.com/course.js"></script>
  </body>
</html>

Replace the example script with your copied script. For a self-paced course, you can instead download the index.html course page from course settings and save it as academy.html. If your project uses a different assets directory, use that directory and its corresponding URL instead.

Start your Angular app and open http://localhost:4200/academy.html (adjust the port if necessary). The embed script creates its own container at the script's position.

3. Link from Angular

Add a normal link in an Angular template:

<a href="/academy.html">Open the academy</a>

Use href, not routerLink, for this page. The embed's JavaScript module initializes when the document loads; removing and re-adding its script during Angular navigation does not reliably initialize it again. A full page navigation avoids that lifecycle issue.

4. Enable and prepare Community

On the course's Layout page, choose a workspace layout that supports Community and turn on Show community. Learners with access can create posts and comment in the course community. See how the course community works.

Before inviting learners, add a welcome post, participation guidelines, and a first prompt such as "What are you working toward?" Decide who will answer questions.

5. Check the learner experience

  • Open the course page directly and through the Angular link, then leave and return.
  • Check the published page on mobile and desktop, including the production hostname.
  • Test sign-in, enrollment, lessons, and community as an enrolled learner; also check what someone without access can see.
  • If the course does not load, check that it is published, the script contains the correct course ID, and the page's hostname is allowed.

Once those checks pass, link the course from your app's navigation or onboarding flow.

Published

More guides