What is the right way to do this in AngularJS? I didn't find any simple answer to this.
I'd like to :
Note: I'm using ui-routing (states) to perform redirections
Thanks.
This works (thanks PSL):
.controller('SeeYouSoonCtrl', ['$scope', '$state', '$timeout',
function($scope, $state, $timeout) {
$timeout(function() {
$state.go('AnotherState');
}, 3000);
}])
It does work also using $location
instead of $state
!
app.controller('SeeYouSoonCtrl', function($scope, $location, $timeout) {
$timeout(function() {
$location.path('/nextsite');
}, 3000);
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With