When clicking on route button bootstrap and js files are not load Angular 13

Viewed 119

I am new in angular and converting html template to angular for learning, but i am facing a problem when i goto the signup page from home's routerlink, the bootstrap and js files not loaded and when i do the page refresh in signup button then bootstrap and js files are loaded.

Route button: Header.component.html

<li><a href="lead.index" routerLink="signup" routerLinkActive="active">Sign up <span class="ti-user"></span></a></li>

app-routing.module.ts:

`const routes: Routes = [
  {path: 'login', component: LoginComponent},
  {path: '', component:HomeComponent},
  {path:'signup',component:SignupComponent}

];`

app.component.html

`<app-header *ngIf="showHead"></app-header>
<router-outlet></router-outlet>`

`<app-footer *ngIf="showHead"></app-footer>`

Note: If I use component in app.component.html and then i click to route button in navbar then all the bootstrap and js files load, but this is not my requirement, because when i did this then signup page show me in Index page also.

`<app-header *ngIf="showHead"></app-header>
<router-outlet></router-outlet>`

`<app-signup></app-signup>
<app-footer *ngIf="showHead"></app-footer>`

Through router link

On Page Refresh

Code link: https://drive.google.com/drive/u/1/folders/1DRmKnnEpE-lEX6iw3lLUXmh6ofVpFONQ

1 Answers

i downloaded the file and it works perfectly on reloads and navigating with routerlink. maybe its because of your browser cache. refresh that and try again.

Related