1

AngularJS 1.x ui-router has the extreme flexible concept of viewports. They seem to me like named routes but offer much more flexibility.

The routes with viewports are not divided into something like primary/aux routes. They are just put anywhere in the html with the ui-view and you can reference them by viewport name from your states/routes.

Now with the new angular 2 router 3 by viktor savkin I can not find that flexibility because the <router-outlet> is directly put to the component, so it seems bound to it.

Maybe my approach is too ui-router like...

Although I know of the angular ui-router for ng2 I do not want to use it:

I have created some sketches (with typos in the url sadly, but I lost the original sketch somehow...)that you understand more what I wanna achieve:

When I am on the state/url /projects/1 - which would be a componentless route with the angular router 3 alpha... - and click the open button of the project then the child meetings for this project are rendered into

I am jumping from one error to the other like:

- can not read data annotations of undefined
- can not find primary outled
- can not find any matching route...

This is a pretty mess to setup this common scenario.

One of the things I tried:

  { path: 'projects', component: ProjectsRootComponent, children: [
      { path: '', component: ProjectsListComponent },
      { path: 'create', component: ProjectsCreateComponent },
      { path: ':id', children:[ // componentless route
           { path: 'meetings',  component: MeetingsListComponent},
      ]}
    ]
  },

I would be glad about any help on this else I try the ui-router which offers an easier and more obvious concept at first sight.

enter image description here

enter image description here

Elisabeth
  • 20,496
  • 52
  • 200
  • 321
  • The router in RC.4 has limited support for aux routes. I haven't seen any mention of adding components to `` of parent components so far though. – Günter Zöchbauer Jul 05 '16 at 04:21
  • 1
    if that situation will not change then there will be another router 4 :P Ok then I try Chris ui-router. Seems the ngrx router: https://github.com/ngrx/router/blob/master/docs/overview/route.md has multiple named components which seems to work like ui-router viewports and do not need a primary router-outlet which is a bad limitation IMHO. – Elisabeth Jul 05 '16 at 09:36
  • It seems even that router is dead... https://github.com/ngrx/router/blob/master/docs/overview/migration.md – Elisabeth Aug 29 '16 at 19:54
  • I don't know about it being dead but the Angular-included routet was modeled a lot like the ngrx. No point in maintaining 2 similar routers. – Günter Zöchbauer Aug 29 '16 at 19:58
  • Sure, but the ngrx was long time before on the market. No need for viktor to show his muscles... I decided to use reactjs and I am happy nothing breaks :-) – Elisabeth Aug 29 '16 at 20:00
  • @Elisabeth well done in forecasting... ngrx is really deprecated now! – Pascal Sep 19 '16 at 15:29

0 Answers0