Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
17 lines (15 sloc) 433 Bytes
import {ngBase} from './ngBase';
export class ngController extends ngBase {
register(app, fn) {
var routes = this.find(fn, 'ngRoute');
var controllerName = this.name;
app.controller(controllerName, this.wrap(fn));
return function ($routeProvider) {
_.each(routes, function(route) {
$routeProvider.when(route.path, _.assign({
controller : controllerName
}, route.options));
});
}
}
}