Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <input type="text" ng-model="data.username">
- <input type="text" ng-model="data.password">
- <button ng-click="login ()">Login</button>
- ---------------------
- $scope.login = funtion(){
- $scope.data = {};
- $http({
- method: 'GET',
- headers: {
- username: $scope.data.username,
- password: $scope.data.password,
- 'Accept': 'application/json'
- },
- timeout: 15000,
- url: 'urlnya'
- }).then(function successCallback(response) {
- console.log(response.data); // Dapet Key
- },function errorCallback(response) {
- console.log(response)
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement