O'Reilly logo

Practical Internet of Things with JavaScript by Arvind Ravulavaru

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required