Is there an callback when I do
$state.go(‘test’);
I want to execute a function when the view is ready …
my other solution is a timeout … but don’t really want to do that
Is there an callback when I do
$state.go(‘test’);
I want to execute a function when the view is ready …
my other solution is a timeout … but don’t really want to do that
crap … I found it
$state.go('test').then(function() {
// let's do something
});
I am calling web service on success, but its giving following error:
TypeError: $http.post is not a function
at http://192.168.10.61:8100/js/controllers.js:656:21
if(response == “success”){
$state.go(‘profile’).then(function($http) {
var apiUrl = 'http://148.251.158.141/EduboldPortalApp/eduboldportal/web/app_dev.php/api/';
$http.post(apiUrl+'student/result/term',{
studentId: '56456456466',
term: 'Term1'
}).then (function (res){ alert(res);
if (res.data.ResponseCode == "1") {
//$scope.showp("Message","Massage Send successfully","Okay")
//$state.go('dashboard')
} else if(res.data.ResponseCode == "0"){
//$state.go('login')
}
})
});
Any idea about this.