Guest User

Untitled

a guest
Mar 22nd, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. var app = angular.module('myApp', ['base64']);
  2. app.controller('customersCtrl', function($scope, $http) {
  3. var auth = $base64.encode("Username:Password");
  4. var headers = {"Authorization": "Basic " + auth};
  5. var url="<URL>";
  6. $http.get(url,{headers: headers}).then(function(response) {
  7. $scope.myData = resonpse.somthing;
  8. });
  9. });
  10.  
  11. var app = angular.module('myApp', ['base64']);
  12. app.controller('customersCtrl', function($scope, $http) {
  13.  
  14. $http({
  15. method : "GET",
  16. url : "<URL>"
  17. headers: {
  18. 'Authorization': 'Basic <encoded string>',
  19. 'Accept': 'application/json',
  20. }
  21. }).then(function mySuccess(response) {
  22. $scope.myData = response.something;
  23. });
  24. });
Add Comment
Please, Sign In to add comment