Csibi Norbert
Csibi Norbert

Reputation: 930

Angular component is not being rendered

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?

Upvotes: 0

Views: 182

Answers (1)

C. Trenholm
C. Trenholm

Reputation: 360

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

Upvotes: 1

Related Questions