Tested and added compatability with Angular 1.2.27