Author: Awais Farooq

  • AngularJS HTML DOM

    In AngularJS, some directives can be used to bind application data to attributes of HTML DOM elements.These directives are: Directive Description ng-disabled It disables a given control. ng-show It shows a given control. ng-hide It hides a given control. ng-click It represents an AangularJS click event. ng-disabled directive:The ng-disabled directive binds AngularJS application data to…

  • AngularJS Select

    In AngularJS, you can create a dropdown list (select box) based on items in an array, or an object. Using ng-options You should use the ng-option directive to create a dropdown list, based on an object or an array in AngularJS. See this example: Note: You can also use the ng-repeat directive to make the…

  • AngularJS Tables

    The ng-repeat directive is used to draw tables in AngularJS. Displaying tables with AngularJS is very easy and simple. Let’s take an example. This example use ng-repeat directive to draw a table. See this example: Displaying with CSS style You can also style the tables by using CSS. See this example: AngularJS Table example with…

  • AngularJS Filters

    In AngularJS, filters are used to format data. Following is a list of filters used for transforming data. Filter Description Currency It formats a number to a currency format. Date It formats a date to a specified format. Filter It select a subset of items from an array. Json It formats an object to a…

  • AngularJS Dependency Injection

    AngularJS comes with a built-in dependency injection mechanism. It facilitates you to divide your application into multiple different types of components which can be injected into each other as dependencies. Dependency Injection is a software design pattern that specifies how components get holds of their dependencies. In this pattern, components are given their dependencies instead…

  • AngularJS Scopes

    The Scope is an object that is specified as a binding part between the HTML (view) and the JavaScript (controller). It plays a role of joining controller with the views. It is available for both the view and the controller. How to use Scope To make a controller in AngularJS, you have to pass the…

  • AngularJS Module

    In AngularJS, a module defines an application. It is a container for the different parts of your application like controller, services, filters, directives etc. A module is used as a Main() method. Controller always belongs to a module. How to create a module The angular object’s module() method is used to create a module. It…

  • AngularJS Controllers

    AngularJS controllers are used to control the flow of data of AngularJS application. A controller is defined using ng-controller directive. A controller is a JavaScript object containing attributes/properties and functions. Each controller accepts $scope as a parameter which refers to the application/module that controller is to control. AngularJS Controller Example Note: AngularJS controller example with…

  • AngularJS Directives

    AngularJS facilitates you to extend HTML with new attributes. These attributes are called directives. There is a set of built-in directive in AngularJS which offers functionality to your applications. You can also define your own directives. Directives are special attributes starting with ng- prefix. Following are the most common directives: ng-app directive ng-app directive defines…

  • AngularJS Expressions

    In AngularJS, expressions are used to bind application data to HTML. AngularJS resolves the expression, and return the result exactly where the expression is written. Expressions are written inside double braces {{expression}}.They can also be written inside a directive: AnularJS expressions are very similar to JavaScript expressions. They can contain literals, operators, and variables. For…