Blog

AngularJS Filter

Filter in AngularJS? Filter in AngularJS is a term which is basically used to transform the data in AngularJS application. To format the data AngularJS could use lots of in-built filter. Like as: – lowercase, uppercase, orderBy and number Let us understand by a simple example.   For Example: <div ng-app=”myModule” ng-controller=”myController”> <p>Company name is {{ companyName | uppercase }}</p> </div> <script> angular.module (‘myModule’, []).controller...
Read More

AngularJS Controller

What is the role of Controller in AngularJS? Data flow in the application is maintained by controllers in AngularJS. In general terms, AngularJS Controller is a JavaScript object which is basically used to maintain the flow of data in the angular application. To make a controller we will use ng-controller directive. Let us understand by a simple example:- For Example:  <div ng-app=”myModule” ng-controller=”myController”> First Name: <input type=”text” ng-model=”firstName”><br> Last Name: <input type=”text” ng-model=”lastName”><br>...
Read More

AngularJS Scope

What is AngularJS Scope? Scope is basically used to make an interface/binding between view and the controller. Here view is Hyper Text Markup Language (HTML) and controller is JavaScript. To access the properties in view (HTML) we should add properties to $scope object in controller. Like as in the previous example we should add two properties studentName and studentId to scope object.  We should access...
Read More

AngularJS – Data Binding

What is data binding in AngularJS? AngularJS application is displayed in Hyper Text Markup Language container which is also representing a view. Data Binding is simply used to communication between view and model.   For Example :   <div ng-app=”NewModule” ng-controller=”NewController”> <p ng-bind=”studentName”></p> </div>   <script> var app = angular.module(‘NewModule’, []); app.controller(‘myCtrl’, function($scope) { $scope.studentName = “alok”; $scope.studentId = “1″; }); </script>   Output: – alok...
Read More

AngularJS model

What is AngularJS model? AngularJS provide a directive called ng-bind which is basically used to bind the values of Hyper Text Markup Controls to the application data. Let us better understand by a simple example.   For Example:  <div ng-app=”NewModule” ng-controller=”NewController “> Name: <input ng-model=”userName”> </div> <script> var app = angular.module (‘NewModule ‘, []); app.controller (‘NewController ‘, function ($scope) { $scope.userName = “angularjs@doc.com “; });...
Read More

AngularJS Modules

What are AngularJS Modules? Basically modules define an application in AngularJS which is also a container for controllers as well as different parts of an application.   How can we create a module in AngularJS? AngularJS has a predefined function “angular.module” which is basically used to create a module in AngularJS.   Syntax :  <div ng-app=”NewModule”> // Statements ………… </div> <script> var app = angular.module (“NewModule”, []);...
Read More