Commit 5d372d62 by Riina Antikainen

Routing changes

1 parent b3eaa941
import { OrganizationComponent } from './organization/organization.component';
import { BrowserModule } from '@angular/platform-browser'; import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { AppComponent } from './app.component'; import { AppComponent } from './app.component';
...@@ -6,9 +5,6 @@ import { AppMockService } from './shared/app.mock.service'; ...@@ -6,9 +5,6 @@ import { AppMockService } from './shared/app.mock.service';
import { AppService } from './shared/app.service'; import { AppService } from './shared/app.service';
import { OrganizationModule } from './organization/organization.module'; import { OrganizationModule } from './organization/organization.module';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { RouterModule } from '@angular/router';
import { NewOrganizationComponent } from './organization/new-organization/new-organization.component';
import { NewEventComponent } from './organization/new-event/new-event.component';
@NgModule({ @NgModule({
...@@ -18,13 +14,7 @@ import { NewEventComponent } from './organization/new-event/new-event.component' ...@@ -18,13 +14,7 @@ import { NewEventComponent } from './organization/new-event/new-event.component'
imports: [ imports: [
BrowserModule, BrowserModule,
BrowserAnimationsModule, BrowserAnimationsModule,
OrganizationModule, OrganizationModule
RouterModule.forRoot([
{path: 'new-organization', component: NewOrganizationComponent},
{path: 'organization', component: OrganizationComponent},
{path: 'new-event/:id', component: NewEventComponent},
{path: '', redirectTo: 'organization', pathMatch: 'full'}
], { useHash: true})
], ],
providers: [{ provide: AppService, useClass: AppMockService}], providers: [{ provide: AppService, useClass: AppMockService}],
bootstrap: [AppComponent] bootstrap: [AppComponent]
......
import { OrganizationComponent } from './organization/organization.component';
import { BrowserModule } from '@angular/platform-browser'; import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { AppComponent } from './app.component'; import { AppComponent } from './app.component';
import { AppMockService } from './shared/app.mock.service';
import { AppService } from './shared/app.service'; import { AppService } from './shared/app.service';
import { OrganizationModule } from './organization/organization.module';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { RouterModule } from '@angular/router';
import { NewOrganizationComponent } from './organization/new-organization/new-organization.component';
import { NewEventComponent } from './organization/new-event/new-event.component';
@NgModule({ @NgModule({
imports: [
BrowserModule,
BrowserAnimationsModule,
OrganizationModule,
RouterModule.forRoot([
{path: 'new-organization', component: NewOrganizationComponent},
{path: 'organization', component: OrganizationComponent},
{path: 'new-event/:id', component: NewEventComponent},
{path: '', redirectTo: 'organization', pathMatch: 'full'}
], { useHash: true})
],
declarations: [ declarations: [
AppComponent AppComponent
], ],
imports: [ providers: [{ provide: AppService, useClass: AppMockService}],
BrowserModule
],
providers: [AppService],
bootstrap: [AppComponent] bootstrap: [AppComponent]
}) })
export class AppModule { } export class AppModule { }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!