Contents tagged with AngularJS
-
AngularJS Directive That Invokes ASP.NET MVC Action
Recently one of the readers asked whether an AngularJS directive can invoke ASP.NET MVC actions. This article shows how a simple AngularJS directive can be created that invokes an ASP.NET MVC action using Ajax. Usually an AngularJS directive is used to perform some UI centric operation. However, nothing prevents an AngularJS directive from invoking some server side code (say an action method) to get some job done.
-
Select All and Delete using ASP.NET MVC and AngularJS
In my previous article I illustrated how jQuery can be used to select and delete records in an ASP.NET MVC application. A few readers asked how the same can be accomplished using AngularJS instead of jQuery. This article shows just that. Recollect how our Index view looks like and how it allows you to select all rows through the header checkbox or individual rows through the respective checkboxes.
-
Use $broadcast(), $emit() and $on() in AngularJS
AngularJS applications may need to communicate across the controllers. Such a communication might be needed to send notifications or to pass data between the controllers. Although there can be different approaches to achieve this goal, one that is readily available is the event system of $scope and $rootScope. Both of these objects - $scope and $rootScope - support three methods namely $broadcast(), $emit() and $on() that facilitate event driven publisher-subscriber model for sending notifications and passing data between the controllers. In this article I will discuss how to raise events using $broadcast() and $emit() and then how to handle those events using $on().
-
Learn ASP.NET MVC, jQuery, AngularJS & HTML5 in Thane. Registration started for November 2014 batches!
We will be conducting a 5 day intensive training programs on ASP.NET MVC, jQuery, AngularJS and HTML5 in the month of November 2014. Small batches, personal attention and real world examples. Registration has already started. In case you or your friends are interested to join please get in touch with us as soon as possible. The courses are conducted in Thane. You may read more details here.