The part of the code I want to change is
var profile = {
name: "web.profile",
parent: "web",
url: "/profile",
title: "Profile",
controller: 'controller1',
controllerAs: 'profile'
};
There is only one controller in use, and I want to use another one, but I get an error when I change my code like this:
var profile = {
name: "web.profile",
parent: "web",
url: "/profile",
title: "Profile",
controller: 'controller1',
controller: 'controller2',
controllerAs: 'profile'
};
So, This isn't the way you should be structuring things. Each view should have only one controller. If you want more functionality, or you need to share information between controllers, investigate injecting a service into the controller.