1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

angular 18 standalone - paramMap changed in router but app won't reload

Discussão em 'Angular' iniciado por D052057, Outubro 8, 2024.

  1. D052057

    D052057 Guest

    here is my code

    <li class="nav-item dropdown">
    <a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
    Photos
    </a>
    <ul class="dropdown-menu">
    <li *ngFor="let p of photoMenu">
    <a class="dropdown-item" [routerLink]="['/photos', p.param]">{{ p.title }}</a>
    </li>
    </ul>
    </li>


    public ngOnInit(): void {
    this.paramsSub = this.activedRoute.paramMap
    .subscribe(
    (params: any | ParamMap) => {
    this.val.photoFolder = params.get('folder'),
    this.val.fileFolder = this.mediaConfig.AssetPhotoFolder + "/" + params.get('folder') + "/";
    this.photoParam = this.val;
    /* this.route.navigateByUrl(this.route.url);*/
    }
    )
    }


    my app loads once. When what ever in p.param changed, my app did not reload. I tried to put onload function in ngOninit() and constructor() and they stay still not working. Any suggestion? Thanks.

    Continue reading...

Compartilhe esta Página