As long as you aren't doing lazy loading, I would think that an API similar to the one mentioned below would be fairly easy. The destination component would simply have to specify a builder interface for building the array that gets passed to "navigate".

I don't see this as having much to do with the router itself.


On 11/09/2016 04:11 AM, David Klingenberg wrote:
I like the idea.

I'm not fan of angular router either.


David

On Wed, Nov 9, 2016 at 3:01 AM, Ondrej Zizka <ozizka@redhat.com> wrote:
Devs.

In Angular, I miss a good routing mechanism like other web frameworks have

Angular:

     editApplication(application: RegisteredApplication) {
         this._router.navigate(['/edit-application', application.id]);
     }

Other framework:

    public void editApplication(Application application) {
         setResponsePage(ApplicationPage.class, new
PageParameters().add("app", application));
    }

Which is often shortened, if the components implements an interface,

     setResponsePage(ApplicationPage.navigate(application));


How about creating a Navigator which would work similarly.

     editApplication(application: RegisteredApplication) {
         this._navigator.navigate(ApplicationComponent, application);
     }

The advantage is that it's type safe and the constants are at a single
point rather than scattered across the web app (or at the component's
class).

WDYT?

Ondra



--
--
Ondrej Zizka, Windup project, Brno

_______________________________________________
windup-dev mailing list
windup-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/windup-dev



_______________________________________________
windup-dev mailing list
windup-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/windup-dev