Updated to support AngularJS v1.2