Hi All,
i am developing simple login form for mobile app and i am new to this ionic
Same post method working through fiddler and not working from ionic angular cross origen blocked error throwing where i need set properties.
Please check the below code.
.controller(‘LoginCtrl’, function ($scope, $http) {
$scope.login = function (user) {
alert(‘hello’);
var userdetails = { grant_type: “password”, username: user.username, password: user.password };
console.log(userdetails);
$http({
url: user.url + "/Token",
method: "POST",
data: userdetails,
headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
}).success(function (data, status, headers, config) {
console.log(data);
}).error(function (data, status, headers, config) {
alert('error found');
});
});
Thanks inadvance
Janardana B