Answers for "angular 10 routing example"

16

angular navigate using component

import {Router} from '@angular/router'; // import router from angular router

export class Component{ 				// Example component.. 
	constructor(private route:Router){} 
  
  	go(){
		this.route.navigate(['/page']); // navigate to other page
	}
}
Posted by: Guest on May-08-2020
0

angular routing example

content_copy
      
      const routes: Routes = [
  { path: 'first-component', component: FirstComponent },
  { path: 'second-component', component: SecondComponent },
];
Posted by: Guest on April-25-2021
0

angular routing example

content_copy
      
      ng generate component first
Posted by: Guest on April-25-2021
0

angular routing example

content_copy
      
      ng generate component second
Posted by: Guest on April-25-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language