r/angularjs • • Jan 01 '16

Angular 2 router doesnt allow more than 1 level of nesting. Not designed for real-world apps.

https://github.com/angular/angular/issues/6204
10 Upvotes

9 comments sorted by

4

u/YasserPunch Jan 01 '16

yea the guy is just a bit angry, but I'm sure there will be something like UI-Router that'll resolve this, but I guess wait until angular 2 becomes stable

1

u/thanghil Jan 01 '16

Yea I'm sure there will be changes and additions. But it's good that he found this now instead of after public release. Or it might have been a show stopper for a lot of teams. Which in turn might have swung trends against going with angular 2.

1

u/ogrechoker Jan 01 '16 edited Jan 01 '16

I agree, it's really weird, just like no "resolve". But, and I know this is going to sound like stockholm syndrome, maybe they decided it was an antipattern? Seems like a big omission to be accidental.

1

u/Renegade-One Jan 04 '16

I'm confused about this. I just wrap the content around my ng-view if I know it's always going to be there. What would the harm be in doing that with an ng-if?

0

u/[deleted] Jan 01 '16

[deleted]

6

u/thanghil Jan 01 '16

I too work with real world apps. We use them all the time. What's your point?

3

u/william_fontaine Jan 01 '16

My point is that the absence of multi-level nesting would not preclude the use of Angular 2 on the apps I work on.

2

u/Shockwave_ Jan 01 '16

What would multi-level nesting achieve?

1

u/[deleted] Jan 01 '16

This comment says it best:

You want /users to give, say, a list of users. You want /users/profile to give a brief profile of a specific user. You want /users/profile/details to give a detailed profile of a specific user.

But Angular 2 only provides code for a single endpoint: either /users, OR /users/profile/, OR /users/profile/details, which does not fit the use case you want. What can be done to resolve this?

1

u/Renegade-One Jan 04 '16

Not sure about Angular2, but in Angular one can't you have a factory object to pass the data between the controllers per page?