I am trying to move one view to another on button click> I am able to move one one view to second .But while moving it start slide from right to left .I need to stop that sliding . mean I need to learn various type of way to move one view to another using animation (left to right or up to down or no animation or down to up) .
Check my code here
http://goo.gl/Q2k6mf
click preview button .And type "ABW" and select "ABW" row .it download data from server and after that it move to second view with sliding why ? I need to stop that sliding .
Secondly I am downloading the data in first controller .is there any better way to hit server or call webservice before moving to second view ?
$scope.rowclick=function(station){
$scope.SEARCH.stationCode=station.stationCode;
$scope.SEARCH.selected = true;
$ionicLoading.show();
$http.get("http://caht.firstrail.com/FGRailApps/jservices/rest/a/departure?crsCode="+ $scope.SEARCH.stationCode).then(function(data){
$ionicLoading.hide();
$state.go('departuredashboard')
console.log(data);
},function(error){
$ionicLoading.hide();
alert("error"+error);
})
}
Actually I need that data on second view ? here is code https://dl.dropbox.com/s/l2dtrxmnsurccxt/www.zip?dl=0
I don't know why you want to remove that animation, Its so sweet, but here you go.
app.config(function($stateProvider, $urlRouterProvider,$ionicConfigProvider){
$ionicConfigProvider.views.transition('none')
// rest of the config
})
Edit: For your second question: here is a code snippet as to how to use resolve of ui-router
.state('stateName',{
url:'/SomeUrl',
resolve: {
resolvedData: function ($http) {
var result = $http.get(yourUrlHere).success(function (data) {
return data;
}).error(function (err) {
return err;
});
return result;
}
}
})
And in your controller , inject "resolvedData"
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments