DEV Community

Cover image for Offline JS In Angular
w3hubs.com
w3hubs.com

Posted on

Offline JS In Angular

In this angular application, we used offline js library which is most important for your web application. If you have no internet then, this library can help you to handle via showing a message like Gmail/Facebook on the top side in notification or alert format. just we first install angular then we install offline js using npm. After that, we configure in the angulr.json file and the offline alert is ready.

What is offline js?

offline js is one type of jquery library that is mainly focused on the internet. If your internet is off/lost then you can see the message on alert format notification. This is base on ajax request with minimal and simple user-interface. This library supports all modern browsers and no Dependencies required.

In this project, we used an offline js library and by default, we used the angular home page. Here we just made one folder which name is offline and after that offline folder, we create 3 files 2 is a CSS file and one is a js file. Then we add a path in angulr.json in styles side and script side. After the run the project with simple commend “ng serve”. After that open in the browser then go to the following step:-

Go inspect element(click f12)
got to application
then click on service workers and click offline

After that, you can see the alert notification message on the top side with a simple user interface.

Make it yours now by using it, downloading it, and please share it.

Source Code

Top comments (0)