What i am trying to implement:
param value should be one of a,b,c,d,e. If the param value is not in the given list of values, user should be redirected.
This implementation is giving me "Infinite $digest Loop" error. How can i make this work?
$routeProvider
.when("/:param", {
templateUrl: function(params){
if($.inArray(params.param, ["a","b","c","d","e"]) > -1)
return "templates/index.html";
else
location.replace("#/a");
},
controller: 'F'
})