“Redirect Angular” Kode Jawaban

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']);
}
Wild Wildebeest

Router Params Angular

// Navigate and send Params
this.router.navigate(['/users/edit/', user.id]);
Lucas Juan

Jawaban yang mirip dengan “Redirect Angular”

Pertanyaan yang mirip dengan “Redirect Angular”

Lebih banyak jawaban terkait untuk “Redirect Angular” di JavaScript

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya