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;
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("/Content/images/bg-home.jpg") !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
add a comment |
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("/Content/images/bg-home.jpg") !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
add a comment |
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("/Content/images/bg-home.jpg") !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
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("/Content/images/bg-home.jpg") !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("/Content/images/bg-home.jpg") !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("/Content/images/bg-home.jpg") !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
java angular typescript spring-boot
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
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
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>
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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>
add a comment |
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>
add a comment |
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>
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>
edited Mar 26 at 10:58
answered Mar 26 at 10:15
Aniket KamtheAniket Kamthe
312 bronze badges
312 bronze badges
add a comment |
add a comment |
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.
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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