RouterLink inside a navbar in a dropdown menu doesn't work (Angular and Springboot)How to pass a parameter to routerLink that is somewhere inside the URL?Angular 2 routerLink doesn't workAngular 2 unit testing components with routerLinkrouterLink only working from navbarAngular 2 routerLink not working inside ng2-bootstrap dropdown inside navbarAnchor tag in navbar takes whole row - angularrouterLink is not working in AngularAngular - routerLink inside routerLinkDropdown button inside navbar not working on angular cliAngular Routerlink doesn't work

What is this green alien supposed to be on the American covers?

Is it rude to refer to janitors as 'floor people'?

Use chown -R while excluding one or two files

Is there an English equivalent for "Les carottes sont cuites", while keeping the vegetable reference?

Is it legal for a supermarket to refuse to sell an adult beer if an adult with them doesn’t have their ID?

Optimising the Selection of MaxValue in Association

Does this sentence I constructed with my junior high school latin work? I write online advertising and want to come off as snobby as possible

How should one refer to knights (& dames) in academic writing?

Is it ethical for a company to ask its employees to move furniture on a weekend?

Why does Eliyahu appear at a brit milah?

Is there a typesafe way to get a Database.QueryLocator?

ArcPy Delete Function not working inside for loop?

what relax command means?

How to check if a new username is a system user?

How to find location on Cambridge-Mildenhall railway that still has tracks/rails?

Why did Steve Rogers choose this character in Endgame?

What is the difference between a Hosaka, Ono-Sendai, and a "deck"?

How Can I Process Untrusted Data Sources Securely?

Cauchy reals and Dedekind reals satisfy "the same mathematical theorems"

How possible is a successful landing just with 1 wing?

Alphanumeric Line and Curve Counting

What is the meaning of [[:space:]] in bash?

What happens if a company buys back all of its shares?

Why does FFmpeg choose 10+20+20 ms instead of an even 16 ms for 60 fps GIF images?



RouterLink inside a navbar in a dropdown menu doesn't work (Angular and Springboot)


How to pass a parameter to routerLink that is somewhere inside the URL?Angular 2 routerLink doesn't workAngular 2 unit testing components with routerLinkrouterLink only working from navbarAngular 2 routerLink not working inside ng2-bootstrap dropdown inside navbarAnchor tag in navbar takes whole row - angularrouterLink is not working in AngularAngular - routerLink inside routerLinkDropdown button inside navbar not working on angular cliAngular Routerlink doesn't work






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















i must develop a web App using spring boot and angular. In this app there is a tab which contains various data (connect with mongoDB).i created a component for add new data in this tab. The problem is when i try to press a link in a dropdown menu inside the navbar doesn't redirect me in the correct page but show me whitelabel page



i tried to use routerLink and href, delete the dropdown and using a button in a navbar.
i added the navar first in my index.html, then i tried inside app.component.



my index.html






 /* When the user clicks on the button, 
toggle between hiding and showing the dropdown content */
function myFunction()
document.getElementById("myDropdown").classList.toggle("show");


// Close the dropdown if the user clicks outside of it
window.onclick = function(e)
if (!e.target.matches('.dropbtn'))
var myDropdown = document.getElementById("myDropdown");
if (myDropdown.classList.contains('show'))
myDropdown.classList.remove('show');



 <header>
<div id="riga-top"></div>
<nav id="navbar">
<div id="area-logo-universita">
<img src="assets/img/logo-unicam.jpg">
</div>
<div id="area-logo-servizio">
<img src="">
</div>
<ul>
<li class="active collapse">
<a href="/contatto">HOME</a>
</li>
<li class="dropdown collapse">
<button class="dropbtn" onclick="myFunction()">Aziende
<span class="caret"></span>
</button>
<div class="dropdown-menu dropdown-content" id="myDropdown">
<a href="/azienda" class="ainside">Aggiungi Azienda</a>
</div>
</li>

</nav>
</header>
<!-- Left side column. contains the logo and sidebar -->
<div class="content-wrapper" style="background-color: rgb(236, 240, 245) !important; background-image: url(&quot;/Content/images/bg-home.jpg&quot;) !important; background-repeat: no-repeat !important; min-height: 710px;">
<div class="container">
<!-- Main content -->
<section class="content">
<app-root></app-root>
</section><!-- /.content -->
</div>
</div>
<footer>
</footer>













share|improve this question






























    0















    i must develop a web App using spring boot and angular. In this app there is a tab which contains various data (connect with mongoDB).i created a component for add new data in this tab. The problem is when i try to press a link in a dropdown menu inside the navbar doesn't redirect me in the correct page but show me whitelabel page



    i tried to use routerLink and href, delete the dropdown and using a button in a navbar.
    i added the navar first in my index.html, then i tried inside app.component.



    my index.html






     /* When the user clicks on the button, 
    toggle between hiding and showing the dropdown content */
    function myFunction()
    document.getElementById("myDropdown").classList.toggle("show");


    // Close the dropdown if the user clicks outside of it
    window.onclick = function(e)
    if (!e.target.matches('.dropbtn'))
    var myDropdown = document.getElementById("myDropdown");
    if (myDropdown.classList.contains('show'))
    myDropdown.classList.remove('show');



     <header>
    <div id="riga-top"></div>
    <nav id="navbar">
    <div id="area-logo-universita">
    <img src="assets/img/logo-unicam.jpg">
    </div>
    <div id="area-logo-servizio">
    <img src="">
    </div>
    <ul>
    <li class="active collapse">
    <a href="/contatto">HOME</a>
    </li>
    <li class="dropdown collapse">
    <button class="dropbtn" onclick="myFunction()">Aziende
    <span class="caret"></span>
    </button>
    <div class="dropdown-menu dropdown-content" id="myDropdown">
    <a href="/azienda" class="ainside">Aggiungi Azienda</a>
    </div>
    </li>

    </nav>
    </header>
    <!-- Left side column. contains the logo and sidebar -->
    <div class="content-wrapper" style="background-color: rgb(236, 240, 245) !important; background-image: url(&quot;/Content/images/bg-home.jpg&quot;) !important; background-repeat: no-repeat !important; min-height: 710px;">
    <div class="container">
    <!-- Main content -->
    <section class="content">
    <app-root></app-root>
    </section><!-- /.content -->
    </div>
    </div>
    <footer>
    </footer>













    share|improve this question


























      0












      0








      0








      i must develop a web App using spring boot and angular. In this app there is a tab which contains various data (connect with mongoDB).i created a component for add new data in this tab. The problem is when i try to press a link in a dropdown menu inside the navbar doesn't redirect me in the correct page but show me whitelabel page



      i tried to use routerLink and href, delete the dropdown and using a button in a navbar.
      i added the navar first in my index.html, then i tried inside app.component.



      my index.html






       /* When the user clicks on the button, 
      toggle between hiding and showing the dropdown content */
      function myFunction()
      document.getElementById("myDropdown").classList.toggle("show");


      // Close the dropdown if the user clicks outside of it
      window.onclick = function(e)
      if (!e.target.matches('.dropbtn'))
      var myDropdown = document.getElementById("myDropdown");
      if (myDropdown.classList.contains('show'))
      myDropdown.classList.remove('show');



       <header>
      <div id="riga-top"></div>
      <nav id="navbar">
      <div id="area-logo-universita">
      <img src="assets/img/logo-unicam.jpg">
      </div>
      <div id="area-logo-servizio">
      <img src="">
      </div>
      <ul>
      <li class="active collapse">
      <a href="/contatto">HOME</a>
      </li>
      <li class="dropdown collapse">
      <button class="dropbtn" onclick="myFunction()">Aziende
      <span class="caret"></span>
      </button>
      <div class="dropdown-menu dropdown-content" id="myDropdown">
      <a href="/azienda" class="ainside">Aggiungi Azienda</a>
      </div>
      </li>

      </nav>
      </header>
      <!-- Left side column. contains the logo and sidebar -->
      <div class="content-wrapper" style="background-color: rgb(236, 240, 245) !important; background-image: url(&quot;/Content/images/bg-home.jpg&quot;) !important; background-repeat: no-repeat !important; min-height: 710px;">
      <div class="container">
      <!-- Main content -->
      <section class="content">
      <app-root></app-root>
      </section><!-- /.content -->
      </div>
      </div>
      <footer>
      </footer>













      share|improve this question
















      i must develop a web App using spring boot and angular. In this app there is a tab which contains various data (connect with mongoDB).i created a component for add new data in this tab. The problem is when i try to press a link in a dropdown menu inside the navbar doesn't redirect me in the correct page but show me whitelabel page



      i tried to use routerLink and href, delete the dropdown and using a button in a navbar.
      i added the navar first in my index.html, then i tried inside app.component.



      my index.html






       /* When the user clicks on the button, 
      toggle between hiding and showing the dropdown content */
      function myFunction()
      document.getElementById("myDropdown").classList.toggle("show");


      // Close the dropdown if the user clicks outside of it
      window.onclick = function(e)
      if (!e.target.matches('.dropbtn'))
      var myDropdown = document.getElementById("myDropdown");
      if (myDropdown.classList.contains('show'))
      myDropdown.classList.remove('show');



       <header>
      <div id="riga-top"></div>
      <nav id="navbar">
      <div id="area-logo-universita">
      <img src="assets/img/logo-unicam.jpg">
      </div>
      <div id="area-logo-servizio">
      <img src="">
      </div>
      <ul>
      <li class="active collapse">
      <a href="/contatto">HOME</a>
      </li>
      <li class="dropdown collapse">
      <button class="dropbtn" onclick="myFunction()">Aziende
      <span class="caret"></span>
      </button>
      <div class="dropdown-menu dropdown-content" id="myDropdown">
      <a href="/azienda" class="ainside">Aggiungi Azienda</a>
      </div>
      </li>

      </nav>
      </header>
      <!-- Left side column. contains the logo and sidebar -->
      <div class="content-wrapper" style="background-color: rgb(236, 240, 245) !important; background-image: url(&quot;/Content/images/bg-home.jpg&quot;) !important; background-repeat: no-repeat !important; min-height: 710px;">
      <div class="container">
      <!-- Main content -->
      <section class="content">
      <app-root></app-root>
      </section><!-- /.content -->
      </div>
      </div>
      <footer>
      </footer>









       /* When the user clicks on the button, 
      toggle between hiding and showing the dropdown content */
      function myFunction()
      document.getElementById("myDropdown").classList.toggle("show");


      // Close the dropdown if the user clicks outside of it
      window.onclick = function(e)
      if (!e.target.matches('.dropbtn'))
      var myDropdown = document.getElementById("myDropdown");
      if (myDropdown.classList.contains('show'))
      myDropdown.classList.remove('show');



       <header>
      <div id="riga-top"></div>
      <nav id="navbar">
      <div id="area-logo-universita">
      <img src="assets/img/logo-unicam.jpg">
      </div>
      <div id="area-logo-servizio">
      <img src="">
      </div>
      <ul>
      <li class="active collapse">
      <a href="/contatto">HOME</a>
      </li>
      <li class="dropdown collapse">
      <button class="dropbtn" onclick="myFunction()">Aziende
      <span class="caret"></span>
      </button>
      <div class="dropdown-menu dropdown-content" id="myDropdown">
      <a href="/azienda" class="ainside">Aggiungi Azienda</a>
      </div>
      </li>

      </nav>
      </header>
      <!-- Left side column. contains the logo and sidebar -->
      <div class="content-wrapper" style="background-color: rgb(236, 240, 245) !important; background-image: url(&quot;/Content/images/bg-home.jpg&quot;) !important; background-repeat: no-repeat !important; min-height: 710px;">
      <div class="container">
      <!-- Main content -->
      <section class="content">
      <app-root></app-root>
      </section><!-- /.content -->
      </div>
      </div>
      <footer>
      </footer>






       /* When the user clicks on the button, 
      toggle between hiding and showing the dropdown content */
      function myFunction()
      document.getElementById("myDropdown").classList.toggle("show");


      // Close the dropdown if the user clicks outside of it
      window.onclick = function(e)
      if (!e.target.matches('.dropbtn'))
      var myDropdown = document.getElementById("myDropdown");
      if (myDropdown.classList.contains('show'))
      myDropdown.classList.remove('show');



       <header>
      <div id="riga-top"></div>
      <nav id="navbar">
      <div id="area-logo-universita">
      <img src="assets/img/logo-unicam.jpg">
      </div>
      <div id="area-logo-servizio">
      <img src="">
      </div>
      <ul>
      <li class="active collapse">
      <a href="/contatto">HOME</a>
      </li>
      <li class="dropdown collapse">
      <button class="dropbtn" onclick="myFunction()">Aziende
      <span class="caret"></span>
      </button>
      <div class="dropdown-menu dropdown-content" id="myDropdown">
      <a href="/azienda" class="ainside">Aggiungi Azienda</a>
      </div>
      </li>

      </nav>
      </header>
      <!-- Left side column. contains the logo and sidebar -->
      <div class="content-wrapper" style="background-color: rgb(236, 240, 245) !important; background-image: url(&quot;/Content/images/bg-home.jpg&quot;) !important; background-repeat: no-repeat !important; min-height: 710px;">
      <div class="container">
      <!-- Main content -->
      <section class="content">
      <app-root></app-root>
      </section><!-- /.content -->
      </div>
      </div>
      <footer>
      </footer>







      java angular typescript spring-boot






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 26 at 9:39









      Kalaiselvan

      1,7301 gold badge11 silver badges24 bronze badges




      1,7301 gold badge11 silver badges24 bronze badges










      asked Mar 26 at 9:13









      Maurizio VenanziniMaurizio Venanzini

      11 bronze badge




      11 bronze badge






















          1 Answer
          1






          active

          oldest

          votes


















          1














          You have to implement Router Link like below and should not use href, you can find complete documentation here.



          Replace following



          <li class="active collapse">
          <a href="/contatto">HOME</a>
          </li>


          By this



          <li class="active collapse">
          <a [routerLink]="['/contatto']">
          HOME
          </a>
          </li>





          share|improve this answer
























            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55353419%2frouterlink-inside-a-navbar-in-a-dropdown-menu-doesnt-work-angular-and-springbo%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            1














            You have to implement Router Link like below and should not use href, you can find complete documentation here.



            Replace following



            <li class="active collapse">
            <a href="/contatto">HOME</a>
            </li>


            By this



            <li class="active collapse">
            <a [routerLink]="['/contatto']">
            HOME
            </a>
            </li>





            share|improve this answer





























              1














              You have to implement Router Link like below and should not use href, you can find complete documentation here.



              Replace following



              <li class="active collapse">
              <a href="/contatto">HOME</a>
              </li>


              By this



              <li class="active collapse">
              <a [routerLink]="['/contatto']">
              HOME
              </a>
              </li>





              share|improve this answer



























                1












                1








                1







                You have to implement Router Link like below and should not use href, you can find complete documentation here.



                Replace following



                <li class="active collapse">
                <a href="/contatto">HOME</a>
                </li>


                By this



                <li class="active collapse">
                <a [routerLink]="['/contatto']">
                HOME
                </a>
                </li>





                share|improve this answer















                You have to implement Router Link like below and should not use href, you can find complete documentation here.



                Replace following



                <li class="active collapse">
                <a href="/contatto">HOME</a>
                </li>


                By this



                <li class="active collapse">
                <a [routerLink]="['/contatto']">
                HOME
                </a>
                </li>






                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Mar 26 at 10:58

























                answered Mar 26 at 10:15









                Aniket KamtheAniket Kamthe

                312 bronze badges




                312 bronze badges


















                    Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







                    Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.



















                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55353419%2frouterlink-inside-a-navbar-in-a-dropdown-menu-doesnt-work-angular-and-springbo%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

                    SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

                    은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현