Hi I want to test my app on a device using ionic view
but my database is on another pc running a web service. I want to know if it is possible to connect to that service from ionic view
. On my browser (ionic serve
) I am struggling with CORS issues would that be the same issue running on ionic view?
Html Code
<ion-view view-title="Dashboard">
<ion-content class="padding">
<div class="list card">
<div class="item item-divider">Recent Updates</div>
<div class="item item-body">
<div>
<b>sector 3</b>
</div>
</div>
</div>
<div class="list card">
<div class="item item-divider">Upcoming</div>
<div class="item item-body">
<p>{{Success + " " + Error}}</p>
</div>
</div>
</ion-content>
</ion-view>
JavaScript Code
angular.module('starter.controllers', [])
.controller('DashCtrl', function($scope, $http) {
$http.get("http://192.168.1.108/TruckService.svc?singleWsdl")
.success(function(data) {
$scope.Success = "SUCCESS!";
})
.error(function(data) {
$scope.Error = "ERROR dude!";
});
})
.controller('ChatsCtrl', function($scope, Chats) {
$scope.chats = Chats.all();
$scope.remove = function(chat) {
Chats.remove(chat);
};
})
.controller('ChatDetailCtrl', function($scope, $stateParams, Chats) {
$scope.chat = Chats.get($stateParams.chatId);
})
.controller('AccountCtrl', function($scope) {
$scope.settings = {
enableFriends: true
};
});