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.