Skip to content

Dynamic Routing with Webpack #668

@DanieleRosada

Description

@DanieleRosada

Hi,
I have a problem with navigationStrategy. I load only the first time moduleId, then when I change the route the moduleId remains the same even if the route #has the right name . (No error)
I use aurelia with webpack.

Thanks

PLATFORM.moduleName('./tipologia/CALDAIA/dettagli');
PLATFORM.moduleName('./tipologia/REFRIGERATORE/dettagli');
PLATFORM.moduleName('./tipologia/SCAMBIATORE/dettagli');
PLATFORM.moduleName('./tipologia/COMPONENTE/dettagli');
PLATFORM.moduleName('./tipologia/BRUCIATORE/dettagli',);
PLATFORM.moduleName('./tipologia/UIR/dettagli');
@autoinject()
export class Installati {

    constructor(private router: Router) { }

    configureRouter(config: RouterConfiguration, router: Router) {
        this.router = router;

        const navStrat = (instruction: NavigationInstruction) => {
            instruction.config.moduleId = './tipologia/' + instruction.params.TipologiaInstallato + '/dettagli';
            instruction.config.href = instruction.fragment;
        };

        config.map([
            { route: '', name: 'no-selected', moduleId: PLATFORM.moduleName('assistenza/utilities/no-selected') },
            { route: ':TipologiaInstallato/:IdInstallato/*', name: 'dettagli', navigationStrategy: navStrat },
        ]);
    }

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions