Made it compatible with Angular 1.2.0