Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

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

PREVIOUS NEXT
Code Example
Javascript :: documentready 
Javascript :: install aos in react 
Javascript :: argument vs parameter javascript 
Javascript :: convert the following 2 d array into 1 d array in javascript 
Javascript :: geolocation in javascript 
Javascript :: create copy button react native 
Javascript :: jquery add td to tr dynamically 
Javascript :: map function react not appearing 
Javascript :: javascript clear table body 
Javascript :: standalone form inside reactive form 
Javascript :: fetch api post req 
Javascript :: chart js laravel mix 
Javascript :: javascript div id add class 
Javascript :: javascript loop through objec 
Javascript :: ngrok angular 8 
Javascript :: vue read url 
Javascript :: js upload file dialog 
Javascript :: how to print two arrays side by side in javascript 
Javascript :: jquery disable form element 
Javascript :: jquery first element 
Javascript :: cheerio load 
Javascript :: adonis andwhere 
Javascript :: kill node process 
Javascript :: hide div js 
Javascript :: auto clicker for cookie clicker 2 
Javascript :: odd even condition with ternary operator 
Javascript :: scroll to top in jquery 
Javascript :: RFC 3339 format js 
Javascript :: check if number is negative javascript 
Javascript :: javascript array value dom 
ADD CONTENT
Topic
Content
Source link
Name
5+7 =