Thursday, 14 July 2016

Object-Oriented JavaScript


Javascript-Logo-Frontend-Labs.png

Objects are used to represent the real world entities in our code like bank account, books, person, etc, by storing all relevant information in one place, i.e, an object. We have two ways to create objects in javascript, i.e., 'Literal notation' and 'Constructor functions notation'.

You must be thinking what are they and what is the difference between them? Right! Let's start with the object definition :

Constructor functions notation

Literal Notation

Read more about Object-Oriented JavaScript visit Findnerd.

Friday, 1 July 2016

Socket.IO using node.js and express

85f2b927bffe54c0d3c00cbfa1d9a1e3915d086e_main_hero_image.jpg

In node.js Socket.io enables real time event based communication. What that means is that we can communicate to the server from the client and in return the server can talk back to the client. Socket.IO uses WebSockets when it can and has fail overs if the browser does not support it.
Step by Step implementation of socket.io using node.js.

Step 1: In first step I am assuming that you have already created the project using express.js and node.js. If you didn't do that then please read my previous blog and create the project. After that just install socket.io module.

Step 2: Now go to app.js there we will require socket.io and connect socket with our server.

Read more about Socket.IO using node.js and express visit Findnerd.

Tuesday, 28 June 2016

Constructor and Object in JavaScript with example

javascript.png

Constructor, classes, and object are the foundation of OOPS language. In javascript, we also use constructor, classes, and object. I will explain this by using a simple example but before starting this we should know what is constructor, classes, and object

Constructor:

The constructor is called at the moment of instantiation. In other words, we can say that when we will create the object of any instance then constructor will call.

In JavaScript the function serves as the constructor of the object, therefore, there is no need to explicitly define a constructor method. Every action declared in the class gets executed at the time of instantiation.

Read more about Constructor and Object in JavaScript with example visit Findnerd.

Thursday, 9 June 2016

Bootstrapping AngularJS

angularjsgoogle.png

In this tutorial, we are going to discuss Bootstrapping in Angular application and also discuss the ng-app directive. When the document is loaded the ng-app directive will bind the Angular js functions with an application. Ng-app is the simplest attribute in angular, it has no value. Bootstrapping is done by the ng-app directive. Ng-app is most important directive in angular which informs that the document has the angular controls.

When you put ng-app inside HTML, it will tell angularjs to control the entire application of HTML. It can also be added in other element of the HTML like body. It is important to add in the parent element so that the child element can run the directives of the angular.

The double curly brackets syntax shows that the it has used one-way data binding or expression. If it is related with the variable it will keep the UI updated with the changes in value. If it is related to the expression, it will keep the UI update when the expression changes.

Read more about  Bootstrapping AngularJS visit Findnerd.

Tuesday, 10 May 2016

Manual and Automatic bootstrapping in AngularJS


Manual and Automatic bootstrapping in AngularJS.jpg

In Javascript framework like AngularJS there is a bootstrapping process involved and there are certain flow that is involved in it.
There are two types bootstrapping involved in AngularJS:
  1. Automatic bootstrapping
  2. Manual Bootstrapping
Let us discuss it one by one.
1. Automatic Bootstrapping:
Automatic bootstrapping in AngularJS starts with placing the script tag at the bottom of the page to improve the application loading time and it also ensure us that the HTML would not block HTML.
Here are the following points which are involved in the process:
  1. As soon as the AngularJS is loaded in the DOM, it will look for ng-app directive, which is also the entry point of the application.
  2. Then it will create the app injector which will retrieve object instances, invoke methods and load modules.
  3. Then it processes all other angular directives only under that DOM element.
Example:
  1. <html>
  2. <body ng-app="myApp">
  3. <div ng-controller="Ctrl">
  4.    Hello {{msg}}!
  5. </div>
Read full Blog about Manual and Automatic bootstrapping in AngularJS visit Findnerd.

Findnerd is also a best place to solve your Tech Query, Ask Questions, Project Management etc.