Code

Test AngularJS app with Karma, Jasmine, and Protractor

Check the code on Github The code is available on GITHUB.Check the repository demo. It’s passed more time than I expected since my last post. These months were really busy (and even more happy) for me and my family; we moved to a new house, and most important our daughter Chiara came to light. A couple of months ago, when I had still free time, I’ve started to write a simple AngularJS todo-app with the …

Standard
General

Bye 2013, Welcome 2014

Another year is almost gone… After I postponed it for a long time, in 2013 I finally started to blog, and also in 2014 my wish is to continue, as long as I’ll have something interesting to share. There are a lot of technologies that I wish to test by myself… one for all, at the top of my to do list, nodejs. However my free time in the next months will suffer a significant …

Standard
Code

XHR Interceptor in an AngularJS web app

Some time ago I wrote about intercepting XHR responses in an AngularJS web app. Several months have passed since that post… and as someone pointed out (here) the method I described has been deprecated. During this time Angularjs 1.2 timely-delivery was delivered (I really admire the guy who choose names for AngularJS releases), and we now have a stable and better way to intercept XHR requests and responses in our web app. We’ll start by …

Standard
Fast Tricks

Show route only after all promises are resolved

Check the code on Github The code is available on GITHUB.Check the repository route-loading-delay-demo. This post is about a trick I learned this summer while reading the book AngularJS, by Brad Green. When a new route is requested in an AngularJS application, it is often necessary to retrieve data from the server to fill the template. If the server request takes too long to complete, it is therefore possible that an incomplete view is presented …

Standard
Fast Tricks

Authentication to a RESTful web service in an AngularJS web app

Last week I wrote about how to contact a RESTful web service in an AngularJS web application using the $resource service. This post is meant to go deeper to an aspect that in that post I just forget to cover, and I have to thank codedungeon, for his comment. This post is about how to deal with web services which require a sort of authentication. Why to use http headers Since RESTful paradigm is stateless …

Standard