Angular and Focus Setting on New HTML Elements

I had to deal with an interesting problem this weekend.  I was working on a screen for a demo project that was using Angular ngRepeat directive to display multiple fields for a sub-entity of a main screen.  Something similar to the demo below. The behavior I wanted to see is as follows.  When a user …

Continue reading ‘Angular and Focus Setting on New HTML Elements’ »

Bootstrap Collapse No Working with Angular

I ran into an issue today when I tried to use Bootstrap’s collapse functionality inside an Angular JS based application.  What would happen is when I click on panel heading, my application would go to the root (default route).  This, of course, is caused by browser processing anchor click event in addition to collapse JavaScript …

Continue reading ‘Bootstrap Collapse No Working with Angular’ »

Building Pagination Directive in Angular and Twitter Bootstrap

One thing that every business app eventually needs is an ability to search for something and show results using paging.  The reason for that is that too many rows in search result set can bring any application to its knees.  Hence, you should always page search results.  If you are building a web application, there …

Continue reading ‘Building Pagination Directive in Angular and Twitter Bootstrap’ »

Create Jasmine Test Harness Page in ASP.NET MVC

In this post I will document how to quickly create a test harness page in ASP.NET MVC project that runs JavaScript tests using Jasmine unit test framework. First of all, let’s talk about project structure.  I have traditional ASP.MVC project and I am using Angular framework to build Single Page Application.  Hence, my project structure …

Continue reading ‘Create Jasmine Test Harness Page in ASP.NET MVC’ »

Talk at AMDev Meetup

I spoke at Atlanta Microsoft Developers Meet up yesterday.   I did the following talk.   Leveraging ASP.NET MVC and Knockout in a Web Application This session is all about leveraging the power of data binding from knockout and traditional ASP.NET MVC views with unobtrusive validation.  We will see how we can inject knockout binding using …

Continue reading ‘Talk at AMDev Meetup’ »

Implementing a Highlighting Directive for Angular

I have been now working with Angular for a bit of time.  I think I am getting a better grasp on the framework.  In a feature I was working on recently, I needed to implement highlight of a search term in search results, similar to search engines.  The actual search was done in a service …

Continue reading ‘Implementing a Highlighting Directive for Angular’ »

Calling MVC Controller On Periodic Basis in JavaScript

Here is a business use case I am trying to address.  After a web page is loaded, I need to make a server call every so often and make certain parts of the web page visible or hidden based on server call results.  In my case I am checking the state of the object in …

Continue reading ‘Calling MVC Controller On Periodic Basis in JavaScript’ »

Binding to Models with Array Properties in ASP.NET MVC

One of the common tasks I encounter periodically is submitting a simple array of strings or numbers from JavaScript to a controller method for processing.  It seems like I struggle often trying to make it work.  So, this time I decided to develop a simple and easy to use solution.  I decided to utilize custom …

Continue reading ‘Binding to Models with Array Properties in ASP.NET MVC’ »

Getting Started with Angular (Modules, Controllers, oh My)

I have started studying Angular framework a few weeks ago.  I always try to keep up with frameworks out there in the world to see if any of them can save me time and fill in specific needs for my projects.  I was attracted by apparent simplicity of Angular, judging by few demos I viewed.  …

Continue reading ‘Getting Started with Angular (Modules, Controllers, oh My)’ »

Validation for Date Pickers in JavaScript

This is really a minor issues that have been bugging me for a little while.  We are using jQuery UI datepicker controls in our MVC application.  There is one annoying part with these controls.  When you pick a date from the calendar popup, the unobtrusive JavaScript validation we use does not kick in immediately, as …

Continue reading ‘Validation for Date Pickers in JavaScript’ »