From <https://github.com/angular-ui/ui-router/wiki>

**templateUrl** can also be a function that returns a url. It takes one preset parameter, stateParams, which is not injected.

```
$stateProvider.state('contacts', {
  templateUrl: function ($stateParams){
    return '/partials/contacts.' + $stateParams.filterBy + '.html';
  }
})

```

What would some of the benefits be of returning the function in the templateURL? Sorry if this is a bit vague. I'm trying to fully wrap my head around ui-router.