wrapping unsafe angular.js calls