Updating the web app

In this section, we will develop the code needed to display the data in real time inside the web app, as well as provide an interface, using which we can turn on/off the LED.

We will get started by adding a toggle switch component. We will use the ngx-ui-switch (https://github.com/webcat12345/ngx-ui-switch) for the same.

From inside the web-app-base folder, run the following command:

npm install ngx-ui-switch -save  

We will use the ng2-charts https://valor-software.com/ng2-charts/ for plotting charts of our temperature and humidity values. We will install this module as well by running the following command:

npm install ng2-charts --save
npm install chart.js --save  

This will install the toggle switch and ng2-charts

Get Practical Internet of Things with JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.