marcoslin / angularAMD

Facilitate use of RequireJS in AngularJS
http://marcoslin.github.io/angularAMD
MIT License
734 stars 171 forks source link

Add a way a default controller path #116

Closed gkorland closed 9 years ago

gkorland commented 9 years ago

Add a way to define a default "controllerUrl" based on the controller name.

e.g. $routeProvider.when('/', angularAMD.route({ templateUrl: 'views/home.html', controller: 'HomeController' }))

Should be like:

$routeProvider.when('/', angularAMD.route({ templateUrl: 'views/home.html', controller: 'HomeController' controllerUrl: 'scripts/homeController' }))

marcoslin commented 9 years ago

This is already works if you setup the baseUrl in your main.js to be scripts.

As result, it would be very cumbersome to implement this default as I will have to load HomeController, and only process the default controllerUrl if that fails, which might take couple hundred milliseconds. Not to mention that each one of us have a different default path. You use scripts but I use js.