Dheeraj Agrawal Dheeraj Agrawal - 1 year ago 117
AngularJS Question

Setting route in angular 2

I am trying to set a route so that if I hit

, it redirects to
and shows the spreadsheet view, but my code is redirecting to:

import { provideRouter, RouterConfig } from '@angular/router';

import {Spreadsheet} from './components/spreadsheet/spreadsheet.component';

const routes: RouterConfig = [
{ path: '', redirectTo: 'spreadsheet', terminal: true },
{ path: 'spreadsheet', component: Spreadsheet }

export const APP_ROUTER_PROVIDERS = [

Answer Source

Use HashLocationStrategy with <base href="/user/beta"> to define what part of the URL is static.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download