In the web applications, sometimes a user will be disconnected from the network. At this time how the application will perform. So, if you create a good app, so it is must detect when the user goes offline and behave accordingly. In some of my freelance project, I was facing this type of problem. After that, I referred HTML5 MDN for working with offline and online events.
For creating a good application, you must know when the user goes offline and write logic accordingly. There is some use-case when detecting offline and online events are important.
When a user is filling a long form and middle of filling the form, the user goes offline due to a power cut or some problem of connectivity. In this use-case detect an offline event and save data in local storage and when user will again be connected with the network, data will send to the server. …
Every HTML element having display property. Display property tells to web page how an element will render on the web page. By default, all elements of HTML having inline display property. By using of User Agent stylesheets, some elements like div, section, ul having block display property.
User agent style sheets are overridden by anything that you set in your own style sheet. …
process is the core module of Node JS and we don’t have a need to install this module. You can simply access this module by require method.
const process = require('process')
If you don’t want to require process module, you directly use it.
By the use of an above snippet of code, you access all the environment variables and values of the system in Node JS app. Like process.env, you will access all the methods of process from any of the files in Node JS app without requiring it. process.nextTick …
We get the power value of exponent over the base number by using three methods:
Reverse a string by using three default or built-in functions:
Chaining all three default methods:
Today we are discussing class constructor and ngOnInit. This is very frequently asked question in the interview if you are going for an Angular Developer.
Angular developer sometimes writes some code in the constructor which are related to angular and sometimes they getting undefined because constructor calls before creating the component.
Now here, we are discussing constructor and ngOnInit.
If you want to see original article, please go to The Dev Family
Constructor will call first after that ngOnInit will fire.
Today we are discussed about Aggregation in MongoDB. Aggregation is the process of grouping the multiple documents and perform any operation and getting the single result. In this medium story, we will take a look at how to create the basic transformation of documents using aggregations.
There are 3 ways to perform aggregation on MongoDB documents:
MongoDB aggregation framework using the data-processing pipeline. MongoDB documents are processed by aggregation pipeline and give the aggregate result. The pipeline method using the MongoDB native methods like a $match, $group, $sort etc.
For working with aggregation, we need to insert some data in the database. …
Now in this medium story, we can create a simple APIs in Express JS ( Node JS Framework ). In this story, we can create a CRUD (Create, Read, Update, Delete) APIs. If you are new in the Node JS and want to learn how to create the basic server and create a basic APIs in Node JS, please read my medium story: Create HTTP Server in Node JS
If you are new to Express framework and doesn’t know how to create a project in Express.js, please refer my medium story: Setup Basic Server with Express Framework. …
The selection sort is the type of sorting algorithm in the programming. It is the simplest type of sorting algorithm that’s why it is used for sort the small list. …