I am using ui-router for routing my app. On ui-router I can define controller like
myApp.config(function($stateProvider, $urlRouterProvider) {
//
// For any unmatched url, redirect to /state1
$urlRouterProvider.otherwise("/state1");
//
// Now set up the states
$stateProvider
.state('state1', {
url: "/state1",
templateUrl: "partials/state1.html"
})
.state('state1.list', {
url: "/list",
templateUrl: "partials/state1.list.html",
controller: function($scope) {
$scope.items = ["A", "List", "Of", "Items"];
}
})
here you can see the controller definition on ui-router state object.
My question is, what is more common, define an angular controller or ui-router controller?
angular.module('controllerExample', [])
.controller('SettingsController2', ['$scope', SettingsController2]);