Can we pass two parameters in $routeProvider.when() function in angular js

I am trying to redirect home.html for two path(s),

for e.g I have a anchor tag like this <a href="">Home</a> And it could be <a href="">Home</a>, In both case I want it to redirect on single URL (home.html)

What I tried

app.config(function($routeProvider){
        $routeProvider
        .when("", "", {
            templateUrl : "home.html"
        })
        .otherwise({
            redirectTo : "home"
        });
    });

But the my above code is not working. Is there any other possible solution for this? If so please suggest, thanks in advance.


ANSWERS:


try this:

app.config(function($routeProvider){
        $routeProvider
        .when("", {
            templateUrl : "home.html"
        })
       .when("", {
            templateUrl : "home.html"
        })
        .otherwise({
            redirectTo : "home"
        });
    });

Nope, the $routeProvider .when requires une string and an object as shown here in the documentation: $routeProvider

Anyway, you can use ui-router to build more complex routing:


Just add two routes instead of merging them ..

app.config(function($routeProvider){
        $routeProvider
        .when("", {
            templateUrl : "home.html"
        })
        .when("", {
            templateUrl : "home.html"
        })
        .otherwise({
            redirectTo : ""
        });
    });


 MORE:


 ? Angular 1.x/2 Hybrid, karma tests not bootstrapping ng1 app
 ? Node server to intercept all request from angular (http) to java spring backend
 ? Angular change url without executing routeprovider
 ? Angular js - call a route without view
 ? .config $routeprovider angularjs
 ? Angular JS not loading view
 ? AngularJS directive vs routeProvider
 ? controller not found through routeProvider
 ? routeProvider not working correctly
 ? AngularJS redirecting to another ng-app module