Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parent Router doesn't know Id of child #670

Open
DanieleRosada opened this issue Nov 26, 2020 · 0 comments
Open

Parent Router doesn't know Id of child #670

DanieleRosada opened this issue Nov 26, 2020 · 0 comments

Comments

@DanieleRosada
Copy link

Good morning,
I am using powerful routing, to rebuild the status after refreshing the page.
But I can't access the parameter :IdRiferimento from the father and therefore I don't know if I have to set the default value or load the previous route.

How can i build the infrastructure to this fairly common problem?
Thanks

@autoinject()
export class Riferimenti {


    columns: Array<ColDef> = [
        { headerName: this.localizer.t('assistenza:riferimenti.codice'), field: 'Codice' },
        { headerName: this.localizer.t('assistenza:riferimenti.nominativo'), field: 'Nominativo' },
        { headerName: this.localizer.t('assistenza:riferimenti.privacy'), field: 'Privacy', valueFormatter: (params) => AgGridValueFormatter.Boolean(params, this.localizer) }
    ];


    constructor(@newInstance(RiferimentiState) private state: RiferimentiState, private router: Router, private localizer: XLocale) { }

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

        config.map([
            { route: '', name: 'nessun-riferimento', moduleId: PLATFORM.moduleName('assistenza/utilities/no-selected') },
            { route: ':IdRiferimento', name: 'riferimento', moduleId: PLATFORM.moduleName('./route/riferimento') }
        ]);
    }

    async activate(params: ParamsRouting) {
        this.state.deselectAll();
        await this.state.getData(params.IdImpianto);

        console.error("riferimenti::", this.state.riferimenti);
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant