Closed sayakb closed 9 years ago
I'm trying to resolve the name of my controller and view dynamically (I am using angularAMD + ui-router):
$stateProvider .state('default', angularAMD.route({ url: '/:module/:action?id', templateUrl: function (params) { var module = params.module; var action = module + params.action.charAt(0).toUpperCase() + params.action.substr(1); return 'app/views/' + module + '/' + action + 'View.html'; }, controller: 'userController', }));
While the above code works, I am unable to find a way to dynamically determine the controller name. Is there any way to do that?
Thought this is better suited for stackoverflow, so I posted it there.
I'm trying to resolve the name of my controller and view dynamically (I am using angularAMD + ui-router):
While the above code works, I am unable to find a way to dynamically determine the controller name. Is there any way to do that?