Closed peterbe closed 8 years ago
What about this?
.classy.routes({
html5Mode : true,
'/:owner/:repo' : {
templateUrl: "/partials/table.html",
controller: 'PullsController'
},
'/' : {
templateUrl: "/partials/form.html",
controller:'FormController'
}
});
That looks cleaner to me xD
It's certainly cleaner but it's braver and a higher abstraction. Dare we?
Yeah, I think the abstraction is too high for the moment. Where possible I want to keep the Classy approach somewhat consistent with controllers. There are many things that you can do with config
, not just routes. @crysfel's solution wouldn't support ui-router either (which is very popular). I think @peterbe's is the most likely solution.
Thanks guys, these API discussions are great. If either of you have API suggestions for directives (#1), filters(#2) or services (#3), I'd love to hear them. :)
I think @peterbe's is the most too.
It's cleaner to have an init and other method i think.
.classy.config({
inject: ['$routeProvider', '$locationProvider'],
init: function () {
this.$locationProvider.html5Mode(true);
this._router();
},
_router: function () {
// init router
}
});
I'm currently faced with
This would look nicer as: