how can I access from nabvar route to web content in angular without losing formats and styles?

0

Hello good afternoon friends, I'm having an inconvenience and I do not know how to approach it. it happens that I am designing a web in angular 6 using materialize. In principle, all the created components showed them vertically (similar to a landing page), but when trying to access, for example, the contact form link showed me the contact form and then the rest of my components.

<!-- app.component.html-->
<app-navbar></app-navbar> 
<app-sidenav></app-sidenav>
<router-outlet></router-outlet>
<app-parallax></app-parallax>
<app-floating></app-floating>
<app-footer></app-footer>

and this is logical, is showing me the structure that I have in app.component.html so I decided to leave as fixed only some components by removing app-parallax which is the content of my website.

<!-- app.component.html-->
    <app-navbar></app-navbar> 
    <app-sidenav></app-sidenav>
    <router-outlet></router-outlet>
    <app-floating></app-floating>
    <app-footer></app-footer>

Create a route called home and link in the navbar that route.

<!-- app.module.ts-->
const routes: Routes = [
  { path: 'contacto', component: ContactoComponent },
  { path: 'products', component: ProductsComponent },
  { path: 'home', component: ParallaxComponent },
  { path: '', redirectTo: '/' , pathMatch: 'full' },
  { path: '**', component: NotFoundComponent },
];

<!-- navbar.component.html-->
<nav>
 <ul id="nav-mobile" class="right hide-on-med-and-down">
  <li>
   <a routerLink="/home"><i class="material-icons left">home</i>Nosotros</a>
  </li>
 </ul>
</nav>

So far so good in terms of structure, but when accessing from the navbar does not show me images associated with my app-parallax but when I reload the url if you show them to me, then you are losing the style or I do not know what you can do be happening I check with Chrome but it does not show any errors and the code is still there but without displaying the style or images associated with that component. I ask for guidance if someone has happened to you. Try to explain it as completely as possible.

Greetings and thanks.

    
asked by Jaime Garcia 27.09.2018 в 20:13
source

0 answers