0

I did some modifications to my angular app, trying to use some routes so that i can use anchor (like ids & href so that it goes to the section). However, i moved everything back to its original state, and now the nav component is not being rendered, any ideas why this is happening?

Here is my app component

<app-landing-page></app-landing-page>
<nav></nav>

And this is my nav component HTML

<nav
class="navbar fixed-top navbar-expand-md navbar-dark"
>

Norbert

<ul class="navbar-nav mr-auto">
  <li class="nav-item" routerLinkActive="active">
    <a class="nav-link" href="#about">About</a>
  </li>
  <li class="nav-item" routerLinkActive="active">
    <a class="nav-link" href="#skills">Skills</a>
  </li>
  <li class="nav-item" routerLinkActive="active">
    <a class="nav-link" href="#contact">Contact</a>
  </li>
  <span class="et-hero-tab-slider"></span>
</ul>
 </div>
  </nav>

I can see only the landing page but i cannot see the nav HTML. Any ideas what goes wrong?

2
  • 1
    So the nav component displays itself in its template? You probably meant something like <app-nav></app-nav> (i.e. you need to use the selector of the component). Given what happens, you really really should learn to use git to be able to rollback to a previous working version. Commented Nov 25, 2019 at 19:38
  • Thanks - I created some component and i messed up the naming... Good point - i will put it straight away to Git Commented Nov 25, 2019 at 19:42

1 Answer 1

1

Did you excplicity change the template selector from <app-nav> to <nav> ? You should make sure that your template selectors dont have naming conflicts with regular DOM elements. If not, check your template selector in your component to see what the selector would be (likely app-nav) and change the <nav> below your <app-landing-page> to whatever it is. If you didnt change the selector you might just be rendering an empty nav element

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.