I'm developing a mobile app using ionic and angularjs. Every thing is so fine , but i don't know why when I'm trying to make a http get request , the failure mathod is called and data is null and the status is 0. What am I doing wrong ? Here is my app.js
angular.module('starter', ['ionic'])//, 'starter.controllers'])
.run(function($ionicPlatform) {
$ionicPlatform.ready(function() {
// Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
// for form inputs)
if(window.cordova && window.cordova.plugins.Keyboard) {
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
}
if(window.StatusBar) {
StatusBar.styleDefault();
}
});
})
.config(function($stateProvider, $urlRouterProvider) {
$stateProvider
.state('login_page', {
url: '/login_page',
templateUrl: 'templates/login_page.html',
controller: 'LoginPageCtrl'
})
$urlRouterProvider.otherwise('/login_page');
})
.controller('LoginPageCtrl', function($scope , $http) {
$http.get('http://91.109.23.124:3000/api/v1/discounts.json').success(function(data, status, headers, config) {
console.log('success');
})
.error(function(data, status) {
console.log('error');
}) ;
})