could you please tell me how to download data from server before open the model screen?I am able to download data from server using http request .But I have few question first is it the best way to download data from server before open model screen .secondly how to send data in model .In other words I need to send download data object in model screen to display the contend of web service .could you please help me how I will do that ?
here is my code
on button click I call web service
$scope.openmodel=function(){
I need to send webservice data on model screen
<ion-modal-view>
<ion-header-bar class="bar-balanced">
<h1 class="title">departure</h1>
</ion-header-bar>
<ion-content scroll="false">
<ion-scroll direction="y" class="departurecontainer">
<div class="row rowclass" ng-repeat="obj in data.data">
<div class="col">
{{obj.schDepart}}
</div>
<div class="col">
{{obj.expDepart}}
</div>
</div>
</ion-scroll>
</ion-content>
<ion-footer-bar class="bar-balanced">
<h1 class="title">Footer</h1>
</ion-footer-bar>
</ion-modal-view>
The problem appears to be in your $scope.openmodel variable
$scope.openmodel = function(){
$http.get("http://caht.firstrail.com/FGRailApps/jservices/rest/a/departure?crsCode=PAD")
.success(function (data) {
$scope.data = data; // you forgot to set the data to $scope.data
alert(data);
console.log(data);
$scope.modalFirst.show();
}).error(function (err) {
alert(err);
});
};