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

How to fetch parameter in angular from URL in external link

Discussão em 'Angular' iniciado por reza hrkeng, Outubro 10, 2024.

  1. reza hrkeng

    reza hrkeng Guest

    I am trying to go on my angular site from a link in my other web site. Like this:

    somebody's login page site

    <html>
    <body>
    ...
    <a href="my-angular-site.com/home/45">
    </body>
    </html>

    *** my angular ***
    cunstructor(private router: ActivateRoute){

    //here or ngOnInit() I tried
    cunst id = This.router.snapshot.paramMap.get('id')
    // or subscribed it correctly
    console.log('id') //output = undefined
    }


    Router config is already set correctly home/:id in path

    Actualy I want to open my angular login page by a link which is located in another any-frameworked website.

    My homepage is -> myangularsite.com/home My login page is -> myangularsite.com/login which all set correct and work fine. But when I want to get an "id" parameter from external link I get that id and rout.navigate(['/login'])

    Please forget about my syntax

    Continue reading...

Compartilhe esta Página