Reputation: 13462
I already saw this thread but it uses ui-router
and I'm only using the $routeProvider
of AngularJS. The code in the thread is:
.controller('SeeYouSoonCtrl', ['$scope', '$state', '$timeout',
function($scope, $state, $timeout) {
$timeout(function() {
$state.go('AnotherState');
}, 3000);
}])
How can I use it with my routeProvider
since I am not using ui-router
? Thank you in advance.
Upvotes: 0
Views: 1217
Reputation: 2708
By $location
method :
code:
.controller('HomeController', ['$scope', '$state', '$location',
function($scope, $state, $location) {
$location.path('/appurl');
}])
Upvotes: 0
Reputation: 21901
You need to use $location
service
$location.path('/anotherURL');
Upvotes: 3