RxJS in the SPA Widget

Quick example of using the Single Page App widget with RxJS code.

Demo: An Example of RxJS in our SPA Widget

In addition to running RxJS code in our standard Code widget, you can also configure it to run in our Single Page App (SPA) widget. This widget is normally used to teach students how to build simple applications (e.g., React, Angular, and other applications).

If you plan to only teach RxJS code and concepts, the Code widget may be enough for your teaching needs. But if you want to teach app development incorporating RxJS, you will want to make use of our SPA functionality also.

Here’s how it will look:

<html>
	<head>
		<script src="/main.js"></script>
	</head>
	...
</html>

We used the same code as in the previous lesson, just to demonstrate that it will also run in the SPA widget. The syntax to import modules is the same as in the Code widget, but in this case, the foo folder can be left blank.

Now that you’ve seen RxJS in action, let’s discuss how to actually set everything up so your RxJS code will run as it has in this tutorial.


In the next lesson, you’ll see how to set up your course, the Code widget, and the SPA widget to work with RxJS.