0

I'm trying to make a login for an ionic (angular) application, and I'd like to use http get. However, it appears to return nothing..

.controller('LoginCtrl', ['$scope','md5', function($scope, $http, md5, $state) {
    $scope.data = {};

    $scope.login = function() {

    var pass = md5.createHash($scope.data.password || '');

    $http.get("http://<link>.com")
        .then(function(response){ $scope.field = response.data; });

    }
}])

$scope.field is just a textfield in the html page. But it just stays blank, whatever the http link is..

edit: and yeah, the pass and credentials aren't used yet, since I first want http get to return something.

Cake
  • 318
  • 6
  • 20
  • 1
    [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS) issue? – Jacob Petersen Feb 01 '16 at 21:18
  • Yeah maybe, but when I use ajax it does return the html >>>> $.ajax({ type: "GET", url: "link..", data: "some data", success: function(html){ return html; .... – Cake Feb 01 '16 at 22:05
  • I found the solution in another post: http://stackoverflow.com/questions/21455045/angularjs-http-cors-and-http-authentication – Cake Feb 01 '16 at 22:18

0 Answers0