Ng-if Examples, Use Cases, and Caveats

Ng-if is a built-in Angular directive for adding and removing content from the DOM. Ng-if is extremely handy for showing and hiding buttons, links, text, images, or other types of content on a page. We covered the differences between ng-show, ng-hide, and ng-if here, so this post will focus specifically on ng-if syntax, examples, and […]


angular.bootstrap Explained in 3 Examples

By default, an Angular application is initialized automatically by loading the angular.js script and placing the ng-app directive to the root element of your application (e.g. <html> tag), like the following:

Explore Angular Courses Alternatively, you can also initialize your application manually if you need, using the angular.bootstrap() function. This is especially useful when […]


ng class Uses Cases, Examples, and Recommendations

ngClass is a very powerful built-in Angular directive for dynamically changing CSS classes on HTML elements. It does this by allowing us to bind scope values as class names. We can then use the state of our application (what variables are currently assigned to) to assign classes to divs, h2s, you name it.  Summed up, […]

Working With Promises in AngularJS Services

Let’s talk about working with promises in AngularJS. To start, $q is a great implementation of promises, allowing you work with deferred objects and be more efficient with Ajax calls. $q api has few useful methods, first one is to create new deferred object using $q.defer(), so this object could be resolve in the future […]

The Difference Between Ng-show vs. Ng-if

There are a variety of built-in Angular directives for showing and hiding content on a page. Ng-show/ng-hide and ng-if are commonly used directives for doing this. Ng-switch and ng-class could also be used to do this (albeit in different ways). This post will explain how ng-show and ng-if differ in their means of hiding content on a page. Explore Angular Courses

How To Get Started With AngularJS

AngularJS is the one of the most powerful framework present for front end developing. You can develop a complete application with it. It features less boilerplate code. AngularJS is maintained by Google. In today’s lesson I will show you a basic example of AngularJS and in this example you can observe the effectiveness of this framework. […]

Diving Into The Details of Two-Way Data-Binding with AngularJS

Before we get into the details of two way data binding, let’s talk about the life cycle of an AngularJS application. So what happens when an AngularJS App loads in the browser? Well, there are three phases that it goes through: The Bootstrap Phase – This is the first phase which starts when the AngularJS […]