Category: Angular

  • Angular Animations

    What Does ngAnimate Do? The ngAnimate module adds and removes classes. The ngAnimate module does not animate your HTML elements. However, when ngAnimate notices certain events, such as hiding or showing an HTML element, the element receives some pre-defined classes that can be used to create animations. The directives in AngularJS that add/remove classes are:…

  • AngularJS AJAX

    AngularJS provides a $http service for reading data and remote servers. It is used to retrieve the desired records from a server. AngularJS requires data in JSON format. Once the data is ready, $http gets the data form server in the following manner: Here the file “data.txt” is employee’s records. $http service makes an AJAX…

  • AngularJS Form Validation

    AngularJS provides client-side form validation. It checks the state of the form and input fields (input, textarea, select), and lets you notify the user about the current state. It also holds the information about whether the input fields have been touched, or modified, or not. Following directives are generally used to track errors in an…

  • AngularJS Forms

    AngularJS facilitates you to create a form enriches with data binding and validation of input controls. Input controls are ways for a user to enter data. A form is a collection of controls for the purpose of grouping related controls together. Following are the input controls used in AngularJS forms: AngularJS provides multiple events that…

  • 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…