Answers for "redirect angular"

6

redirect angular

import { RoleComponent } from './role/role.component';
import { AppComponent } from './app.component';
import { NgModule }             from '@angular/core';
import { RouterModule, Routes } from '@angular/router';

const routes: Routes = [
  { path: '', redirectTo: '/AppComponent', pathMatch: 'full' },
  { path: 'role', component: RoleComponent },

];

@NgModule({
  imports: [ RouterModule.forRoot(routes) ],
  exports: [ RouterModule ]
})
export class AppRoutingModule {
  constructor(private router: Router)
}

functionOnWhichRedirectShouldHappen(){
  router.navigate(['/role']);
}
Posted by: Guest on February-27-2020
1

router params angular

// Navigate and send Params
this.router.navigate(['/users/edit/', user.id]);
Posted by: Guest on November-25-2020
0

how to add redirec router in angular

Angular Path Router Redirect
Posted by: Guest on January-28-2021

Code answers related to "redirect angular"

Code answers related to "Javascript"

Browse Popular Code Answers by Language