• +91 9723535972
  • info@interviewmaterial.com

Angular Interview Questions and Answers

Related Subjects

Question - Demonstrate navigating between different routes in an Angular application.

Answer -

The following code demonstrates how to navigate between different routes in an Angular app dubbed “Some Search App”:

import from"@angular/router";

.

.

.

@Component({

 selector: 'app-header',

 template: `



 







 


`

})

classHeaderComponent {

 constructor(private router: Router) {} 

 goHome() {

this.router.navigate(['']); 

 }

 goSearch() {

this.router.navigate(['search']); 

 }

}

Comment(S)

Show all Coment

Leave a Comment




NCERT Solutions

 

Share your email for latest updates

Name:
Email:

Our partners