I need to load controllers dynamically from certain directories, i.e. instead of this:
$routeProvider.when(path, {
templateUrl: 'templates' + path + '.html',
controller: 'myController'
});
the directory where it is placed should be pointed:
$routeProvider.when(path, {
templateUrl: 'templates' + path + '.html',
controller: 'controllerDir/myController'
});
I guess there should be a some standard approach for it(?). May be there is some way to use dynamically loading file containing the controller similar to the qQuery fashion (getScript)?