AngularJS & # 8594; UI router where to define the controller
1 answer
The best practice is to define a controller in the provider config (this also works with the base byte $ routeProvider). It's best to keep your opinion as "clean" as possible.
As @JBNizet is added, this is also the only way the router can inject resolved dependencies into the controller (see the permission property you can pass to your route / state config)
+1
source to share