Using authorization in angular.js