-
Notifications
You must be signed in to change notification settings - Fork 248
Support routing directly to a component #425
Comments
@sethladd Are you thinking something like this?
or more generic?
|
How about something like this?
|
Either I like the last one, because strings are hard to get right (no static analysis) |
BTW if we can get this, it is a huge win for ease of use. Thanks for considering! |
I'm actually looking into different angular specific route definition DSL. Early draft: view.configure(router, {
'foo': ngRoute(
path: '/foo',
view: 'foo.html',
mount: {
'bar': ngRoute(
path: '/bar',
component: 'bar-component',
defaultRoute: true
),
'baz': ngRoute(
path: '/:baz'
)
}
),
'qux': ngRoute(
path: '/qux',
view: 'qux.html'
)
});
|
I like |
Actually, I thought about it more, and it seems like
The first iteration will probably have to be |
@pavelgj Can you create an issue regarding the route definition DSL you're looking into? I have some feedback but don't want to go off-topic in this issue. |
Thanks, really looking forward to it. |
Not really, this is a separate feature. #435 was a prerequisite. |
This works, thanks! |
This still in the works? |
Yes, it's still being considered. It's just not as simple as it seems -- it makes expression extractor a bit more complicated. |
@pavelgj Can you work on this or should I find someone else? |
@mhevery This requires changes to the expression extractor transformer, so it's a bit more work than I expected. I can work in this, but it's not very high on my todo list (next week?). |
Specifying view html for a route will be a great feature we badly lack. It will allow not only to specify a component, but also to pass attributes to it. Currently we have to use a workaround described by me here: #837, which is not correct as it causes ng-view to be reevaluated each time, even if not needed. |
This is now implemented. You can route to an inline template ( views.configure({
'foo': ngRoute(
path: '/foo',
viewHtml: '<foo-component></foo-component>')
}); |
Thanks! |
It was a treat cleaning out a bunch of extra view files today. Thanks for the hard work everyone! :) |
Thanks a lot - we have updated our code to use the new feature and it works perfectly. |
My views are simple, they just have a single custom component. I'd much rather route directly to a component, and remove the view altogether.
ex:
thing.html:
The text was updated successfully, but these errors were encountered: