Advertisement
Guest User

Untitled

a guest
May 28th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. <input type="text" ng-model="data.username">
  2. <input type="text" ng-model="data.password">
  3. <button ng-click="login ()">Login</button>
  4.  
  5. ---------------------
  6.  
  7. $scope.login = funtion(){
  8. $scope.data = {};
  9. $http({
  10. method: 'GET',
  11. headers: {
  12. username: $scope.data.username,
  13. password: $scope.data.password,
  14. 'Accept': 'application/json'
  15. },
  16. timeout: 15000,
  17. url: 'urlnya'
  18. }).then(function successCallback(response) {
  19.  
  20. console.log(response.data); // Dapet Key
  21.  
  22. },function errorCallback(response) {
  23. console.log(response)
  24.  
  25. });
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement