Dot Net Stuff

Applying Controllers to Views in Angular JS Application

Defining controllers is only part of the process—they must also be applied to HTML elements so that AngularJS knows which part of an HTML document forms the view for a given controller. This is done through the ng-controller attribute, and following example shows how it can be done in our example.

Continue Reading>>

Applying Filters in Angular JS

Filters are applied in template expressions contained in views. The data binding or expression is followed by a bar (the | character) and then the name of the filter. Filters in Angular JS are used in views to format the data displayed to the user. Once a filter is defined, it can be used throughout a module, which means we can use them to ensure consistency in data presentation across multiple controllers and views.

Continue Reading>>

Creating Multiple Views in Angular JS Application

In Angular JS Application, each controller can support multiple views, which allows the same data to be presented in different ways or for closely related data to be created and managed efficiently. In Following example, you can see how we have added a data property to $scope and created a second view that takes advantage of it. Creating multiple view is one of the most important features of Angular JS.

Continue Reading>>

Understanding Dependency Injection in Angular JS

One of the AngularJS features that causes the most confusion is dependency injection (DI). It can be hard to figure out what DI is, how it works, and why it is useful. Even if you have encountered dependency injection in other frameworks like ASP.NET MVC, AngularJS takes an unusual approach and mixes in some features that are distinct from other languages. As you will learn an AngularJS application consists of different components: controllers, directives, filters, and so on.

Continue Reading>>

Defining Filters in Angular JS Application

Filters in Angular JS are used in views to format the data displayed to the user. Once a filter is defined, it can be used throughout a module, which means we can use them to ensure consistency in data presentation across multiple controllers and views. This is one of the powerful and very important features of Angular JS. In this article we will learn different ways that filters can be used, including using the built-in filters that come with AngularJS.

Continue Reading>>

Defining Directives (Custom) in Angular JS Application

Directives are the most powerful AngularJS feature because they extend and enhance HTML to create rich web applications. There are lots of features to like in AngularJS, but directives are the most enjoyable and flexible to create. We have already discussed about the built-in directives that come with AngularJS, but we can also create our own custom directives when the built-in ones don’t meet your needs. We can create custom directives via the Module.directive method. You can see a simple example of a custom directive below.

Continue Reading>>

Creating Multiple Controllers in Angular JS Application

We can create multiple controller in Angular JS Application. Almost all project have the requirement to use multiple controller in Angular JS. Each controller have different responsibility and functions depends upon our requirements. Let’s consider following example, which shows that how can we create multiple controller in an Angular JS Application.

Continue Reading>>

Defining Modules Values in AngularJS

The Module.value method allow us to create services that return fixed values and objects. This may seem like an odd thing to do, but it means we can use dependency injection for any value or object, not just the ones you create using module methods like service and filter. It makes for a more consistent development experience, simplifies unit testing, and allows you to use some advanced features, like decoration.

Continue Reading>>

Defining Services in AngularJS

Services are singleton objects that provide any functionality that you want to use throughout an application. There are some useful built-in services that come with AngularJS for common tasks such as making HTTP requests. Some key AngularJS are delivered as services, including the $scope and $filter objects that I used in the earlier example. Since this is AngularJS, you can create your own services, a process that I demonstrate briefly here and describe in depth in

Continue Reading>>

Using Modules to Organize Code in Angular JS

Till now we have learn about how AngularJS uses dependency injection with factory functions when you create components such as controllers, filters, and services. We also know that the second argument to the angular.module method, used to create modules, was an array of the module’s dependencies

Continue Reading>>