I have a customer search view that, by default, simply loads a form for first and last name. It can, however, take those params as arguments in the URL. My app config contains:
$stateProvider
.state({
name: "search",
url: "/search",
templateUrl: "partials/customerSearch.html",
controller: "CustomerSearchCtrl"
})
.state({
name: "searchGiven",
url: "/search/:fn/:ln",
templateUrl: "partials/customerSearch.html",
controller: "CustomerSearchCtrl"
})
This works, but it seems like it has unnecessary redundancies. Is there a better way? Is this something $urlRouterProvider
should handle?