Dot Net Stuff

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

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

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

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

Defining Controllers in Angular JS Application

Controllers are one of the most important building blocks of an AngularJS application, and they act as a channel between the model and the views. When we are developing a big Angular JS Application, we have to works with multiple controllers, each of which delivers the data and logic required for one aspect of the application. We can define a Controllers are using the Module.controller method, which takes two arguments: the name of the controller and a factory function, which is used to set up the controller and get it ready for use. Following statements that create the controller.

Continue Reading>>

Using Modules to Define AngularJS Components

It is required to define an Angular JS Module while you creating it. There is a method angular.module which is used when we want to define an Angular JS Module. The angular.module method returns a Module object that provides access to the most important features that AngularJS provides via the properties and methods. The module method supports the three arguments described below, although it is common to use only the first two.

Continue Reading>>

Working with Modules in Angular JS Application

Please don’t make any confusion in your mind. Understanding the concept of Modules is very easy in Angular JS. Modules are the top-level components for AngularJS applications. Although, we can build simple AngularJS Application without using the reference modules, but this is not recommend doing so because simple applications Become complex applications over time, and you’ll just end up having to rewrite the application when it becomes Unmanageable. Working with modules is easy, and the handful of additional JavaScript statements that you need to set up and manage modules in your Angular JS Application is very important. Angular JS Modules have three main roles in an AngularJS Application :

Continue Reading>>

Concepts while working with Angular JS Application

As we know AngularJS applications follow the MVC pattern. But while developing Angular JS Application it requires a wide range of building blocks. There are, of course, the headline building blocks—the model, the views, and the controllers—but there are lots of other moving parts in an AngularJS app as well while developing Angular JS application which includes modules, directives, filters, factories, and services. During development you use these smaller components to flesh out the bigger MVC pattern.

Continue Reading>>

Understanding AngularJS Directives with example

AngularJS lets you extend HTML with new attributes called Directives. These are special attributes starting with ng- prefix. In this article we will learn about ng-app, ng-init, ng-model and ng-repeat. Following are the brief introductions of all these directives.

Continue Reading>>

What is Angular JS Expressions? How Angular Js Expressions is different with JavaScript Expression?

If you have read Introduction of Angular JS and First Angular JS Application example. Than you should familiar with AngularJS Expressions. Angular JS expressions are very common concepts in Angular JS. Basically it is used to bind application data to html. In this article I am going to explain about Angular JS Expressions.

Continue Reading>>