[windup-dev] NavigationService

Ondrej Zizka ozizka at redhat.com
Tue Nov 8 21:01:18 EST 2016


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



More information about the windup-dev mailing list